Jump to content

link to next part of a form(same record same id)


frankstr

Recommended Posts

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

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");

?>

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.