View Full Version : refered access only
BroChris
01-16-2003, 06:22 PM
I'd like to check what page refered a user, and he did not come from a certain page, deny him access (or at least redirect to another page). How can I do this?
mordred
01-16-2003, 07:15 PM
There is
echo $_SERVER['HTTP_REFERER'];
that gives you a clue about the page that refered to your script. But take into consideration that you cannot trust the data in HTTP_REFERER: It can be spoofed. Also, some user agents don't send this header, and some proxies filter it. Don't trust on the availability of it.
If the page the user has to come from is under your control, it's IMO better to store a flag variable in a session and check that instead.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.