Hi I'm trying to write the code to redirect to another URL when the user makes a choice and hits 'Go' from the HTML form drop down menu. I think the problem lies in the fact that register_globals is off. here is my code:
<?php
if($POST['location'] != null){
header("location: $POST['location']");
exit;
}
?>
<html><head><title>Redirect</title></head>
<body>
Choose a site to vist:
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
<select name="location">
<option value="http://www.ineasysteps.com">In Easy Steps</option>
<option value="http://www.phpbuilder.com">PHP Builder</option>
<option value="http://www.amazon.co.uk">Amazon</option>
<option value="http://www.ebay.co.uk">ebay</option>
</select>
<input type="submit" name="submit" value="Go">
</form>
</body>
</html>
I suspect my syntax is wrong on line 3. i.e.,
header("location: $_POST['location']");
but I can't seem to figure it out. Any help would be greatly appreciated.