Jump to content


Photo

Mutiple Page Form


  • Please log in to reply
2 replies to this topic

#1 mvosoughi

mvosoughi
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 20 April 2006 - 09:04 AM

Hello all,

I'm using the following code within the <form></form> tags to pass the variables to the next page:

<?php
foreach($_POST as $key=>$value){
if ($key!="submit"){
$value=htmlentities(stripslashes(strip_tags($value)));
echo "\t<input type=\"hidden\" name=\"$key\" value=\"$value\">\n";
}
}
?>

It does work on my localhost but when I load the script to the webserver, which already supports php and I have many php codes running with no problem, it will not pass the variables to the next page. Is there anything that I'm missing?

Thank you.

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 20 April 2006 - 10:58 AM

Code looks fine. How are you retrieving the passed values on the next page? If register_globals is OFF on your live server you'll need to retrieve passed values from the $_POST array on that next page.
Legend has it that reading the manual never killed anyone.
My site

#3 mvosoughi

mvosoughi
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 20 April 2006 - 11:08 AM

AndyB, thank you for the reply. You were right, I wasn't retrieving the data ($_POST) currectly. It is working now.

Thank you.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users