----- Original Message ----- From: "Mallen Baker" <[EMAIL PROTECTED]> To: "<" <[EMAIL PROTECTED]> Sent: Friday, May 30, 2003 8:48 AM Subject: [PHP] Passing page referrer on as variable
> I have a login process for an intranet that aims to allow all people to view the intranet front page, but as soon as they click on a link, they are taken to a login page. Once they have logged in (authentication via sessions, drawing from info held in a mysql database) they can then go wherever they want. > > What I am trying to get is that when they click on a link and login, the process then forwards them on to the page whose link they clicked on, rather than presenting them back with the home page. > > Basically, every page calls a function that checks whether the person is logged in, and if not redirects them to the login page. The login page register the $http_referer as a variable on the form - and when the form is submitted (ie. login takes place) that variable is passed on, and used for a location: instruction on success. > > The real kicker is that this worked fine when I developed it - using IE5 on my Mac (and still does). Only after a short while did I discover and realise that it wasn't working at all on IE5.5 / 6 on Windows. But surely these are server side operations, and if it works for one it should work for others? > > The only thing I can think of is that IE5.5 on Windows doesn't pass on the referer info in the same way?? In which case, is there an alternative way of capturing this that would withstand the differences? > > Thanks - Mallen print_r($_SERVER) to see what values are available to you. If HTTP_REFERER is blank, which is entirely possible, try HTTP_HOST and SCRIPT_NAME and pass those to your from the intranet page to your login script instead of getting the referrer after you've redirected to the login script. - Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php