You are here: Re: forbidden error « PHP Language « IT news, forums, messages
Re: forbidden error

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация