tommy2shoes Posted March 14, 2011 Share Posted March 14, 2011 Hi I use Dreamweaver to do a lot of my work on a php/mysql database. I have two tables - applications and contacts and they are linked by the id appid. When I view a page with all of the application and contact details the url contains the appid as a number at the end (eg .../Summary.php?appid=639) When I want to edit one of the contacts I go to the edit page but this is identified by a contact id so that url looks like: ../EditContact.php?contactid=32 When I update the contact's details I would like to return to the summary page but can't as the url gets muddled between the two different ids so I end up at a page with no info on it. How can I get round this? I'm sorry my explanation isn't very clear but any help is much appreciated. Link to comment https://forums.phpfreaks.com/topic/230583-changing-code-passed-on-by-url/ Share on other sites More sharing options...
aabid Posted March 14, 2011 Share Posted March 14, 2011 You can use PHP header function to redirect automatically to the page you will give as an argument. Make sure you don't output anything before header function otherwise it will give error. for example:- $contact_detail = $data_to_be_changed; header(Location: ROOT_DIR/summary.php?appid=123); Link to comment https://forums.phpfreaks.com/topic/230583-changing-code-passed-on-by-url/#findComment-1187298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.