$_SERVER['HTTP_REFERER'] doesnt work with firewall on?


hi. my pages doesnt work on some of my client's computer. the page depends on $_SERVER['HTTP_REFERER'] variable. those who were not able to see the page propperly reported taht they have firewall on.

is $_SERVER['HTTP_REFERER'] against firewall?
is there a way to resolve this..?
sutejokAsked:
Who is Participating?
 
matt_mcswainConnect With a Mentor Commented:
No, not always. It's totally dependent on the client and can be easily spoofed w/ about 3 lines of code useing curl; among other ways. Sorry, you just can't depend on it.
0
 
ldbkuttyConnect With a Mentor Commented:
>> is there a way to resolve this..?

Due to the "untrustable" nature of HTTP_REFERER, I'd use $_SESSION or $_POST or $_GET variable to store the filename $_SERVER["PHP_SELF"] and check it in the next page.. Like this :

my_page1.php :

<?
session_start();
$_SESSION["referal"] = $_SERVER["PHP_SELF"];
// blah..blah..
?>

referred_page.php :

<?
session_start();
if(!isset($_SESSION["referal"])) {
 // Session not set, re-direct the user...
}
else {
 // User came through the my_page1.php. so allow him..
}
?>
0
 
sutejokAuthor Commented:
thx guys
0
All Courses

From novice to tech pro — start learning today.