Re: Error when using HTTP Location header
| From: | Jonathan Haddad | Date: | Wed, 21 Jul 2004 19:11:37 +0000 |
| Subject: | Re: Error when using HTTP Location header | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191381@lists.php.net to get a copy of this message | ||
I've seen it work with a relative URL, which suprised me, because until I had saw that I would have agreed with you.
Jon
Chris Shiflett wrote:
--- Arnout Boks <arnoutboks@hotmail.com> wrote:header('Location: ' . urlencode('loginForm.php?error=Incorrect password'));The Location header requires an absolute URL. Also, this is the header you are sending: Location: loginForm.php%3Ferror%3DIncorrect+password I doubt that's the URL you meant. URL encode the value of URL variables, not the entire URL. Lastly, I hope you're not blindly displaying $_GET['error'] on your loginForm.php page, otherwise you have a cross-site scripting vulnerability. Hope that helps. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'ReillyComing Fall 2004HTTP Developer's Handbook - Samshttp://httphandbook.org/PHP Community Sitehttp://phpcommunity.org/