Forum Moderators: coopster

Message Too Old, No Replies

Problem with HTTP_REFERER?

         

louponne

9:42 pm on Oct 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a site that has the occasional word on the page defined in a popup glossary window. You click on the word, and a popup opens up in front, with the definition.

I'm thinking that google is going to find those popup pages, and display them as search results.

Since the popup pages have no navigation except for a "close page" link, well, yuck.

I was thinking that I could check the HTTP_REFERER variable to see if the visitor was coming from my own site - if they were not, I'd display some site navigation so they could find their way to my site.

But when I check on my local server, and click on one of the links to open the popup window, HTTP_REFERER is just plain empty.

Is my reasoning wrong somewhere?

vincevincevince

9:43 pm on Oct 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the links are javascript?

louponne

9:52 pm on Oct 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yes, it's a javascript window.open

hm - so maybe it's totally normal that the HTTP_REFERER variable is empty, huh?

If that's the case, then I can just plan on displaying links if HTTP_REFERER is *not* empty?

<added later, after testing>

YEP, it works!

Thanks, vincevincevince, for asking the right question! :)

</added>

MonkeeSage

10:17 pm on Oct 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might need to check the referrer in JS from the page with the glossary links using 'document.referrer', because I don't think the window.open method carries the referrer from the click event (I could be mistaken though).

Jordan

louponne

3:01 pm on Oct 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might need to check the referrer in JS from the page with the glossary links using 'document.referrer', because I don't think the window.open method carries the referrer from the click event

Yes, that's exactly what my testing has determined. So actually, what I'm doing is checking the referrer - if it exists, then I know the visitor has come from an outside page, and display links. If referrer is empty, I know the page has been opened via javascript, and hide the links. Seems to work!