Posted by peter on 05/26/07 23:26
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
> <html><body>
>
> <form method="post" action="do_redirect.php">
> <p>I want to go to:</p>
> <select name="location" size=1>
> <option value="http://www.msn.com/">MSN</option>
> <option value="http://www.linuxchix.org/">Linuxchix</option>
> </select>
>
> <input type="submit" value="Go">
> </form></body></html>
>
> send it to this page
>
> <?php
> header("location: $location");
> exit;
>
> ?>
>
> I get this error:
> HTTP Error 403 - Forbidden
> Internet Explorer
>
> However, when I hard code it, I have no problem
> <?php
> header("location: http://www.php.net");
> exit;
>
> ?>
>
It should be :-
<?php
header("location: $_POST['location']");
exit;
?>
BUT you should double check that $_POST is a valid option that was selected.
Navigation:
[Reply to this message]
|