Since you're checking to see if people are logged in and then sending them to 
the login page if they're not...I would pass, via GET, the page they are on 
when they were checked for being logged in and then the script on your login 
page would take that GET and embed it into the POST form. When the user does 
successfully login then you can throw them back to whatever was passed 
through. As someone else mentioned and the PHP docs mention as well, 
HTTP_REFERER isn't very reliable. I believe you can use $HTTP_SELF for the 
first page when it needs to find out who it is. 

Hope that helped.


On Thursday 12 September 2002 02:41, Jiaqing Wang wrote:
> Hello, All,
> I'm currently working on a problem which is in need of HTTP referer or the
> similar technique, but I couldn't seem to find any article or links which
> illustrate the idea, I tried $_SERVER['HTTP_REFERER'] but somehow it didn't
> work for me. Let me breifly explain what I did here:
>
> I have login page called login.php, in this page I do
>
> 1. verify user the username and password against my backend database.
> 2. once passwd is verified, opens up a session with this login session.
> 3. header("Location: ${_SERVER['HTTP_REFERER']}") this will send user who
> just logged in back to the whichever page they came from.
>
> I also have a bunch of service scripts providing the content of my site
> like mysite.php which invokes the login.php page if it determines that the
> user is not logged in, after user goes through the logging in process, the
> login.php will re-direct it back to this particular page, of course the
> location of the page is dynamicly determined by HTTP_REFERER.
>
> The problem I'm having right now is that after the user is logged in, the
> login.php can never send it back to the page the user came from, it will
> just redraw the login.php page. Obviously, $_SERVER['HTTP_REFERER']
> contains the location of itself instead of the location of the page sent
> the user here.
>
> I hope this is clear to you, if any of you out here knew a clue please help
> me out. Any comment is greatly appreciated.
>
> JJW
> 9/11/2002

-- 

Henrik Hudson
[EMAIL PROTECTED]

Note:  Beware of Dragons - Thou art crunchy and taste good with ketchup.


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

Reply via email to