frankstr Posted February 1, 2007 Share Posted February 1, 2007 LS I want to make a form in PHP in different parts on different pages After completion of the first part of the form the data of the users are added to a MYSQL database. The user gets the message "your data were added" So far so good. After this I want to link the user to the next part of the form on another page. with the next string it is possible to link to next part of the form on the next page <?php header("Location: secondpartoftheform.php"); ?> LS To make this possible I have to go on with the same id. When I just jump to the other form a new id is created in the MYSQL database. Is there a way to redirect to the next page ofe the same form without creating a new id? thnx Frank Link to comment https://forums.phpfreaks.com/topic/36712-link-to-next-part-of-a-formsame-record-same-id/ Share on other sites More sharing options...
pocobueno1388 Posted February 1, 2007 Share Posted February 1, 2007 Well, I am assuming the id is stored in the URL...but you can change this up to fit wherever your ID is coming from. <?php $id = $_GET['id']; // Wherever your ID value is coming from header("Location: secondpartoftheform.php?id=$id"); ?> Link to comment https://forums.phpfreaks.com/topic/36712-link-to-next-part-of-a-formsame-record-same-id/#findComment-175072 Share on other sites More sharing options...
frankstr Posted February 2, 2007 Author Share Posted February 2, 2007 LS Used your code as follows in my first part of the form: if (@mysql_query ($query)) { print '<P>your data were aded</P>'; $blog_id = $_GET['blog_id']; // Wherever your ID value is coming from header("Location: secondpartoftheform.php?blog_id=$blog_id"); Still the data in the second part of the form were added in a new record. I noticed in my editor that the expression: "$blog_id" has the color black instead blue like your example. What could be the problem? thnx Frank Link to comment https://forums.phpfreaks.com/topic/36712-link-to-next-part-of-a-formsame-record-same-id/#findComment-175724 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.