2 quesions one on logic and one on forms (php)

Associate
Joined
19 Jul 2006
Posts
1,847
Using Php and Mysql I have a form that we fill in.
so it goes impact.php (form) ---> add.php ( the information is entered into the database when this page loads, This page displays a summary of what is entered in a table and theres 2 buttons one that says this info is correct which takes the user back to the start page. the other button says no edit this information.)

If the user clicks edit I want to bring back the record just entered and populate the form again with that info, the form has checkboxs, dropdown selectors and free text areas.

So 1 how do i get the record back thats just been entered?

Then how do i get this back into the form?

Then it would be a update statement.

TIA
 
Thanks Russinating,

But that went totally over my head. Which is the easiest to do?

I send variables as URL from the impact to the add page. how do i get that back into the form?
 
Thanks for the help guys,

if i have this
PHP:
$sql = sprintf("INSERT INTO `database`.`Entries` (`Username`, `School`, `Dateofvisit`, `Tspent`, `Activity`, `Management`, `Coords`, `In_School`, `PCP_BSF`, `Learning_Platform`, `SRF`, `eSafety`, `Projects`, `Reprographics`, `FS`, `Evolve`, `Other`, `Wholeschool`, `Headteacher`, `SMT`, `Subjectleader`, `ICTsubjectleader`, `LAOfficer`, `eSafetyperson`, `Goveners`, `Admin`, `Classteacher`, `TA`, `Parents`, `Students`, `Description`, `Impact`, `Action_Plan`, `Success_Criteria`, `Notes`) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')",
																							 mysql_real_escape_string($name),
...... ect
mysql_query($sql); 
mysql_close();

Which at the moment works and puts it into the database when the page loads.( after form been submitted)

I want to move this code now and attach it to the thee details are correct button, which also redirects to another page. ( iwant to submit to database here)
PHP:
<form name=correct type=post action = submited.php>
<input type='submit' value ='These details are correct' onclick="correct.action='submited.php';return true;">
<input type='submit' value ='Edit these details' onclick="correct.action='edit.php';return true;"> </form>
 
Back
Top Bottom