FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


HTTP Referer...





Diablosblizz
Okay, I made a script that checks the referal of the user's last page. Here's the code:

Code:
<?php
$page = $_SERVER['HTTP_REFERER'];

if($page == "http://hotelmario.info/checko.php" || $page == "checko.php") {
PAGE HERE.
} else {
   echo "Unable to access this file directly. Please go to the site and play the game. Please click <a href='http://hotelmario.info/main.php'>here</a> to return.<BR><BR>$page";
   }
   ?>


This works perfectly fine in Firefox, but if you try it on Internet Explorer 6 (not sure about 7) then it will display the else.

Is it possible to fix this so it works in both IE and Firefox?

Thanks!!!!
Star Wars Fanatic
I don't know about IE does it, but according to the PHP Manual:

[quote=PHP Manual]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.[/quote]

It's best just not to do that sort of thing, instead, maybe try sending a POST or GET (POST being the better idea) along with the link, and just check for that, and send that variable in a hidden field from the page that you want it linked from.
Related topics
dot files
Problam about google ad code
Fantastico could be updated
.htaccess IP Blocking
I just got me a com domain for my site check it out !
the new eminem video clip
Site Nav Suggestions...
'Where To' For Domain Name Registration?
creating .htaccess?
Referals?
Image Magick on vacation?
Do you want a free domain?
C++ pointers
Web Protect
Referer
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.