frankstr Posted February 2, 2007 Share Posted February 2, 2007 LS I already posted this subject and did receive an answer I tried. 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 record: "blog_id". When I just jump to the other form a new blog_id is created in the MYSQL database. Is there a way to redirect to the next page of the same form without creating a new id? From pocubueno Irecieved this answer: 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. Code: <?php $id = $_GET['id']; // Wherever your ID value is coming from header("Location: secondpartoftheform.php?id=$id"); ?> Used pocubueno's 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.