> Don't you mean they get sent to login.php? Nope -- index.php contians just the form elements for the user to type in user id and password, then it calls login.php which contains just the script.
> The Location: header requires a correctly formed URL, ie http://... It works fine having Location: main.php and $file contains a relative path, like "file_name.php?v1=123" and yes, I have checked that. Any other ideas? Sam ----- Original Message ----- From: "Jason Wong" <[EMAIL PROTECTED]> Newsgroups: php.general To: <[EMAIL PROTECTED]> Sent: Wednesday, July 30, 2003 10:12 PM Subject: Re: [PHP] session header issue > On Thursday 31 July 2003 06:39, Sam Folk-Williams wrote: > > I've got a site with a login authentication script in a file called > > login.php. Every page has a simple session check on top of it, as well > > as line that captures the name of the file the user is trying to view. > > The idea is that if the user tries to go straight to an inside page > > without logging in, they get sent to the login page (index.php) with the > > Don't you mean they get sent to login.php? > > > variable $file marking the page they wanted to view. When they log in, > > the $file variable is sent to login.php and (if $file is set) login.php > > returns them to the page they were trying to view using a simple header > > redirect: header("Location: $file"); > > The Location: header requires a correctly formed URL, ie http://... > > > Problem: instead of sending them to the page they wanted to view, they > > get sent to this URL: login.php?file=/dir/file_name.php?v=123 > > > > What's going on here? Why doesn't "Location: $file" return the contents > > of $file? > > What do you mean? Have you checked that $file contains what you expect it to > contain? Putting $file inside double-quotes doesn't magically transform its > contents. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > ------------------------------------------ > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > ------------------------------------------ > /* > QOTD: > "Unlucky? If I bought a pumpkin farm, they'd cancel Halloween." > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php