PDA

View Full Version : CGI Variable: HTTP_REFERER


oceanbear
04-10-2004, 07:05 PM
I am trying to note where a visitor comes from when they arrive at my site - wanting to give credit where it is due and also for curiosity.

I thought the way to do this was to look at the CGI HTTP_REFERER variable.

My first attempt failed because I realized (duh) that my index.html is picked up without my really ever knowing it. The first time someone clicks on something HTTP_REFERER says that they came from MY site (of course).

So then I tried replacing my index.html with a direct CGI call to my server and THEN looked at it. But alas - there was nothing in the variable.

How does one get a hold of this information?

oracleguy
04-11-2004, 07:59 AM
You should be able to use any server-side language to log the referer on the first page of your website. However, you may want to put the code in a server-side include and put it on all your pages then check to see if it isn't from your server, if it isn't or blank, you can log it because your visitors aren't always going to come through the front door, so to speak.

What server languages can you use on your server? ASP, PHP, etc?