Re: Error when using HTTP Location header
| From: | Matthew Sims | Date: | Wed, 21 Jul 2004 17:24:35 +0000 |
| Subject: | Re: Error when using HTTP Location header | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191355@lists.php.net to get a copy of this message | ||
> Hi,
>
> I'm building a login page that redirects the user to the login form when
> an
> incorrect password is entered. An error message is passed as an URL
> parameter. Something like:
>
> if(!$pwd == $correctPwd){
> header('Location: ' . urlencode('loginForm.php?error=Incorrect
> password'));
> exit;
> }
>
> When I use this page and enter a wrong password, I get a 'Acces Denied'
> error from my local Apache (1.3) web server. It seems that the server is
> looking for a file called 'loginForm.php?error=Incorrect password', can't
> find it, and since directory browsing is disabled, it gives a 'Acces
> Denied'
> error.
>
> Is there a way I can prevent this with PHP? Or do I have to change
> something
> in my Apache config? (Does anybody know what?)
>
> Thanks in advance,
>
> Arnout
Instead of passing "Incorrect Password" why not simply pass something
easier like the number 1 or the word no? Then check if $error=="1" (or
"no") and simply go from there?
--Matthew Sims
--<http://killermookie.org>