Okay, I've build the script to display all of the entries (one per page) in textboxes.
I also have another script, similar to it, but that is meant to add completely new entries.
On both scripts, I use a form to insert everything. Here's the start of the form:
Code:
<form name=form1 method=post action=add.php onsubmit='return validate(this)'><input type=hidden name=todo value=post>
And the submit button:
Code:
<input type=submit value=Submit>
The entries are called and added the following way: (just stated one)
Code:
<input type='text' name='name' value='{$row['name']}'>
On the add.php page the $todo is stated:
PHP Code:
<?php
if(isset($todo) and $todo=="post"){
$status = "OK";
$msg="";
if($status="OK"){
echo "<font face='Verdana' size='2' color=red>$msg</font><br><input type='button' value='Retry' onClick='history.go(-1)'>";
}else{
if(mysql_query("insert into addresses(id,name,address,postalcode,city,phone) values('$id','$name','$address','$postalcode','$city','$phone')")){
echo "<font face='Verdana' size='2' color=green>Record succesfully added</font>";}
else{ echo "Database Problem, please contact Site admin";
//echo mysql_error();
}
}
}
?>
Now, I don't know how to change this part so that it'll update the entries, instead of adding a new entry. Do you know what to change? Thanx!
Ps. Sorry forgot to edit last message instead of post new.
Bookmarks