Forum Moderators: DixonJones

Message Too Old, No Replies

Referal strings

         

big_jimmi

5:39 pm on Mar 22, 2007 (gmt 0)

10+ Year Member



Hi guys

Simple question but how do you get the referal string from a click. IE if someone gets refered to my site and makes an order - I currently get there ip address using the session and php. But how do I tell where that visitor has come from?

I know I can use google analytics etc but if I wanted to know for each individual user with a view of writing it to a database?

Many thanks in advance

Status_203

8:26 am on Mar 23, 2007 (gmt 0)

10+ Year Member



You need to get the referrer when the first page request in the session is made. In PHP this should be in $_SERVER['HTTP_REFERER'].

Bear in mind that the referrer cannot be absolutely relied upon. It is possible to set up some browsers to not pass the referrer. Some client security software will also strip out the referrer (and some will inappropriately attempt to advertise themseleves in the referrer causing their users to not see images that are hotlink protected!).

big_jimmi

9:36 am on Mar 23, 2007 (gmt 0)

10+ Year Member



Thanks for your help guys