Jump to content

Recommended Posts

Heres the deal. My form passes variables to the form_results.php. I have made a link on form_results.php so that users can go to another page. In that next page, i want users to be able to see 2 variables from the form_results.php page.

 

Here are the variables as they appear in pages:

 

Form:

$quote_num

$total

 

From Results:

echo "$quote_num"

echo "$total"

 

New Page:

echo "$quote_num"

echo "$total

 

Can't get the variables in the third page. What am i doing wrong?

Thanks in advance! ???

Easiest thing to do is pass them in the URL to page 3 .. then use $_GET to pull the variables from the URL.

 

You can also store the variables in $_SESSION and pass them on the the next page.

 

From results page:

<a href="http://www.yoursite.com/new_page.php?quote_num=$quote_num&total=$total" />New Page</a>

 

New page:

echo $_GET['quote_num'];
echo $_GET['total'];

 

 

Session Method::

 

From results page:

session_start();
$_SESSION['quote_num'] = $quote_num;
$_SESSION['total'] = $total;

 

New Page:

session_start();
echo $_SESSION['quote_num'];
echo $_SESSION['total'];

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.