Jump to content

old topic renewed redirect to second part of form;same record


frankstr

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.