RE: [PHP] How to Force user to start with Homepage(PHP3)
| From: | Craig Vincent | Date: | Wed, 02 Aug 2000 20:00:29 +0000 |
| Subject: | RE: [PHP] How to Force user to start with Homepage(PHP3) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-9808@lists.php.net to get a copy of this message | ||
> Here's the idea behind it. If someone is coming to your site by
> punching in a URL, the $HTTP_REFERER will be blank. If they come to
> your site by clicking on a link, the $HTTP_REFERER will be whatever
> domain the link was on. If that domain is not yours, then you redirect
> them to your home page. Otherwise, the file is parsed normally.
There's some major issues with that...first and foremost some browsers (such
as Opera) allow users to disable issuing the HTTP_REFERER header to the
server. Even worse many browsers (AOL 3, 4 and possibly 5) Do not issue
HTTP_REFERER codes when a new window is opened....
Example if I go to a site using AOL, right click on a link and select (OPEN
IN A NEW WINDOW)...that new window will NOT contain an HTTP_REFERER code so
I'd then be slingshotted back to the beginning of the site...this would also
happen if the HREF had a target="_new" command attached to it...I don't know
what would happen with a javascript redirect.
However I can't really offer a better suggestion :) Perhaps maybe use
session tracking to do nothing more than ensure that person started at the
main page (to be assigned a session number)...then have that either stored
in a cookie or dynamically passed in all HREF links...then if a page hit
from a user doesn't have a valid session id...it is redirected to the main
page.
Sincerely,
Craig Vincent
-------------------------
Senior Programmer
Jazzmonkey Media Inc.
http://www.jazzmonkey.com
-------------------------