Forum Moderators: coopster
Say for example I have this form:
<form name=searchFormMaker method=post action="search_country.php">
<b>Search by Country:</b><br>
<select name="Country">
<option selected value="All">All Countries</option>
<option value="Canada">Canada</option>
<option value="United Kingdom">United Kingdom
<option value="United States">United States
</select>
<input type=submit name=Submit value="Search">
</form>
Then on the next page I try to output that data:
<?
echo $Country;
?>
Whatever the user selected for country will not be displayed, I just get a blank under PHP5. Yet if I test the same code under PHP4 it works without any problem.
Does anyone know what might be going on here?
It is almost certain to be a register_globals [php.net] issue.
A warm welcome to Webmaster World. :)
register_globals [php.net] is set to off by default in PHP5 for security. You need to access your vars using the $_POST array:
echo $_POST['Country'];
dc
edit:Coop beat me to it.