On Wed, 21 Jul 2004 19:00:06 +0200, Arnout Boks <[EMAIL PROTECTED]> wrote:
> 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;
> }
> 

You shouldn't be urlencoding the whole string. By doing that, you're
telling apache that ? is part of the filename. Use this:

if(!$pwd == $correctPwd){
    header('Location: loginForm.php?error='.urlencode('Incorrect password'));
    exit;
}

or just do it yourself:

if(!$pwd == $correctPwd){
    header('Location: loginForm.php?error=Incorrect%20password');
    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
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> !DSPAM:40fea0be13902792533464!
> 
> 


-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to