Get HTTP_REFERER in popup

A

agflem

Is there any way to grab the HTTP_REFERER server variable in a pop up?

Example:
www.site1.com pops open www.site2.com that needs to see if it was
popped from www.site1.com

Currently, that value is empty.

If not, are there any suggestions on how to test that a page was
spawned from a site and not just typed into the address bar?
 
M

McKirahan

Is there any way to grab the HTTP_REFERER server variable in a pop up?

Example:
www.site1.com pops open www.site2.com that needs to see if it was
popped from www.site1.com

Currently, that value is empty.

If not, are there any suggestions on how to test that a page was
spawned from a site and not just typed into the address bar?

Some firewall and web filtering software, such as some versions of Zone
Alarm, block HTTP_REFERER's by default.

Personal Firewalls
http://www.wykes.org/firewalls.html

"This is because some firewalls block certain (harmless) interactions with
this site. Some even block the transmission of http information, in direct
contravention of the accepted standards."
 
M

Mark Schupp

On the client-side you could check for the existence of a parent window
(window.opener). I don't know if you can get the URL of the opener if it is
a different site however.
 
A

agflem

Ah, good idea :) Thanks Mark ... I added a server side work around too
that checks for a key stored during login ... if there isn't a matching
key when site2 is spawned ... window.close();
 
D

Dave Anderson

Is there any way to grab the HTTP_REFERER server variable in a pop up?

I'm not sure what your workaround was, but this will do the job:

<A HREF="http://www.site2.com/" TARGET="tgtWin"
ONCLICK="window.open('',this.target, ...)">Click Me</A>



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top