Jump to content

Passing a variable


yoyo
 Share

Recommended Posts

I have 3 pages. page 1 formPage 2 infoPage 3 email the contents of page 1I have this in the top of page 2 but the varibales aren't being passed onto the page 3 <?phpforeach ($_POST as $key=>$value) { $hidden .= '<input type="hidden" name="' . $key . '" value="' . $value . '">';}?>Any help would be appreciatedCheers

Link to comment
Share on other sites

Use sessions. Put session_start() at the top of each page (before any content) you want the variable to be accessible (pages two and three), then on page two put

foreach ($_POST as $key=>$value) {	$_SESSION[$key] = $value;}

Then on page three you can access the variables as $_SESSION[$key]

Link to comment
Share on other sites

I have this in the top of page 2 but the varibales aren't being passed onto the page 3
Do you have form tags and a submit button or are you just clicking a link to go to the next page? You need to put the hidden input tags into a form that has a submit button that goes to the next page.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...