RE: [PHP] Environment Variables -- HTTP_REFERER

From: Date: Thu, 24 Oct 2002 04:48:17 +0000
Subject: RE: [PHP] Environment Variables -- HTTP_REFERER
Groups: php.general 
Request: Send a blank email to php-general+get-121199@lists.php.net to get a copy of this message
Well an ad hoc method is to immediately start a session when the user visits a page and then insert the following into a db the following. 1. SID or session_id() 2. current host and page $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'] Evertime they visit a page you update their record w/ the current page, if you need the last page, you pull it out of the db before you update it. You can pull the last page they were at by pulling page out of the db that matches their SID (and/or TIMESTAMP if you want). Periodically though you will need to run a script and delete old SID's as your db will get big fast. Ad hoc but works. -Peter > -----Original Message----- > From: Darwin [mailto:superbus22@attbi.com] > Sent: Thursday, October 24, 2002 06:34 > To: php-general@lists.php.net > Subject: [PHP] Environment Variables -- HTTP_REFERER > > > Hello, > > I am running PHP 4.0.6 in a Windows XP environment. I need to > know a better > and more reliable way to check which page the user came from > before the page > he/she has currently accessed. I tried to look at > HTTP_REFERER, but PHP says > it is unreliable. Is there a better way? Here is what PHP has > to say about > HTTP_REFERER: > > 'HTTP_REFERER' > The address of the page (if any) which referred the user agent to the > current page. This is set by the user agent. Not all user > agents will set > this, and some provide the ability to modify HTTP_REFERER as > a feature. In > short, it cannot really be trusted. > > Any help would be greatly appreciated. > > Darwin > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#121199) next »