View Full Version : HTTP_REFERER: want to reflect where the user came from.
hogtied
12-21-2002, 08:19 AM
Hello members,
I understand how HTTP_REFERER works and got it to work. Except it only reports the URL that called the script, which is the URL location of my home page.
The results I was looking for was when the user comes to my home page then the CGI would kick in and get me the URL where they came from, if any.
Does anybody have any suggestions?
PS: this kinda goes along with the post "How to call a CGI script within HTML (http://www.codingforums.com/showthread.php?s=&threadid=11826)"
Thanks,
Hogtied :confused:
ACJavascript
12-21-2002, 10:14 PM
Well,, Create a script that catches the refferer and add it just like Philip showed you in your other post "CGI called in html"
<!--#exec cgi="cgi-bin/Catch.cgi"-->
What do you want to do with the referrer?
print it to a database?
Show it to your user?
and you need SSI to call a script like that. Im sure you do judging by your last post there,, but just want to make sure.
hogtied
12-22-2002, 05:39 AM
Kewl thanks,,
Naw, I want to keep track of where the users are coming from.. I want to see if my google ads are paying off.. :)
Thanks..
And yes i do know that they have to be ssi.. which involves renaming .HTML to .SHTML at least for them to run on my web hosting service..
hrsdh
12-30-2002, 01:24 AM
Hi,
All this kind of information should be stored in the server's log files by default - are you able to get at these files on your server? If so, times, dates, referrers, the works will be available to you without having to do any CGI coding whatsoever :)
Cheers,
S.H.
hogtied
12-30-2002, 04:09 AM
Yeah I do have server logs on my webhosting site. But, for one they also list all the "gets", meaning for every picture I have there's an entry for it. Two, I would like it to be formated in such a way that I can import into an excel sheet or access to do some charting of my own.
Thanks,
hrsdh
12-30-2002, 02:22 PM
Hi,
Sounds fair enough...in that case I'd probably write a (perl) script which would analyse the log file for you and dump its results into a file in a desirable format. It'd probably be simpler in the long-run.
Cheers,
Stuart.
hogtied
12-30-2002, 05:55 PM
that's a good way of doing it hrsdh. Except:
1) i have limited resource to how many times a cgi script can be called.
2) oh well i guess i could download the file to my local computer and run the script manually from here to generate the delimited file.
I'll try that.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.