Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

http_referer doesnt work in IE...

Status
Not open for further replies.

bledileka

Programmer
Nov 15, 2006
16
Hi people !

I tried to secure one page with http_referer. this is wot i did actualy :


<?php $kot = $_SERVER ["HTTP_REFERER"];
if ($kot == "page1.php")
{
echo "do some stuff";
} else {
echo "<a href=\"java script:window.close()\"><font color=\"#000000\">Close The Window !</font></a> ";
}
?>

Im not sure this is the right way but this is wot i thought can work.
Im havin problems with browsers. Its not workin with IE. With Mozilla works perfectly but in IE it just gives me Close the Window.
Can anybody help me on this ?

thnx.
 
some browsers do not provide the HTTP referrer. i would not counsel reliance on it.
 
Hi

bledileka said:
Code:
echo "<a href=\"java[highlight red] [/highlight]script:window.close()\"><font color=\"#000000\">Close The Window !</font></a> ";
There is no space, right ?

As jpadie wrote, do not rely on [tt]HTTP_REFERER[/tt]. Many people and security softwares are paranoid regarding that and just disable it.

I am not paranoid ( I think... ) and I use FireFox. But is just one click to change between sending and not sending [tt]Referer[/tt] HTTP header. Thanks to Chris Pederick's Web Developer extension.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top