I am moving an existing Apache/PHP/MYSQL application to a new Redhat8 server with the PRM installed Apache/PHP/MYSQL suite. The new server is set with register_globals off. I have to convert the old code's use of register_globals on, and have run into this problem:
a.php - a form with a hidden value and a submit
###########
$x=1;
echo "<form action=\"b.php\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"num\" value=\"$x\">";
echo "<input type=\"submit\" value=\"Send\" >\n";
echo "</form>\n";
###########
b.php - a page that attempts to read the "POST" value from a.php
foreach ( $_POST as $key=>$val ) {
stripslashes($val);
echo "$key <br> ";
echo "$val <br>";
}
###########
Output:
num
1num=1
The key is correct, but the passed value is 'doubled up'.
Server info from phpinfo();:
PHP Version 4.2.2
POST["num"] 1num=1
Thanks in advance for the help.