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!

getenv('HTTP_REFERER') in Firefox vs IE7 (iframes)

Status
Not open for further replies.

kumais

Technical User
Apr 27, 2007
4
Hi,

I use getenv('HTTP_REFERER') in an iframe to keep track of the referring URL (of the page loaded in the frame). It works fine in Firefox but in IE7, it reads the URL of the parent window instead of the iframe page.

Just to make it clear:

e.g.

I have a page
which contains an iframe with something like <iframe src = "
Now somebody clicks on a link in the iframe which loads another page within the same iframe. Say this page contains the following code:

$ref = getenv('HTTP_REFERER');

In Firefox,

echo $ref;

returns


but in IE7, it returns


Does anybody know of a workaround to make it work properly in IE7?

Thanks.
 
Referrer headers are browser-dependent. Some browsers do not send them at all, and some allow you to change them if you wish. So do not depend on them.

That said, from your descrition I understand that IE7 has it right and not Firefox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top