This topic is locked

Go to edit page after adding new record in Master/Child record

4/10/2010 12:16:09 PM
PHPRunner General questions
F
FunkDaddy author

Sergey/Jane,
I have searched in the forums and tried several different suggestions that seemed like they should work, but none of them do... so now I'm not sure if I'm simply an idiot or maybe there is a caveat to doig what I I'm looking to accomplish when it relates to Master/Child forms!
Heres the scenario:
I have a Master form linked to 2 child tables. I would like to add a new master record, then simply have the form redirected to the edit page of that newly added record after I click on the save button. That's it... simple.
The default behavior now is that when I click save on an add new record, it automatically takes me to another add new page... this unfortunately, can cause confusion for my users who think the record was mistakenly deleted after adding or never saved to begin with (yes, even though there is a "record saved" message with edit and view links displayed on top of the page as per PHP Runner's default behavior).
Can someone PLEASE help me with this?
Best,
M

K
Khris 4/11/2010

In your Add Page:After Record Added, you need to redirect back to the edit page and point to the record you just added.

//********** Redirect to another page ************

header("Location: anypage_edit.php?editid1=$values["KeyField"]");

exit();