Page 1 of 1

Need help with this script

Posted: Wed Jan 04, 2006 7:01 pm
by jaymoore_299
I'm trying to track where the surfer came from and how many clicks were generated from the site of origin.

I made all the links on my site like this http://www.domain.com/out.php?url=LINK ADDRESS
and inside the out.php I recorded the http_referer and recorded a click of one in a database. The idea was that for every click, that click would be recorded in the mysql database for that particular referer.

This does not work because his http_referer will always be from my site because he is clicking the links from my page.

I tried giving the surfer a cookie with his own http_referer in it as he came to my site, and tried to access that with every click to the out.php script, however this fails because the out.php cannot seem to read the cookie made when the surfer arrived at the main page. (I have no idea why)

I'm running out of ideas. How do I save the original http_referer that the surfer had when he came to my page and have it accessible to out.php ?

surfer comes to domain.com with his http_referer, now how do I have code this information so that domain.com/out.php can have access to this? Any ideas?

Posted: Thu Jan 05, 2006 8:39 am
by twigletmac
Have you tried saving the referrer to a session variable?

Mac

Posted: Thu Jan 05, 2006 11:33 am
by jaymoore_299
I haven't done that yet. I think I have the cookies working.

Posted: Thu Jan 05, 2006 11:48 am
by John Cartwright
fyi, http_referrer won't always exist

(incase you didn't know)