views:

40

answers:

2

I have 2 domain names on second domain name I want to check last visited link.

for eg. on 1st domain name contact us link is given when user click on it, it takes him to second domain name. now how will I know which link is clicked.

+1  A: 

You can check the HTTP REFERER header. In PHP you can find it in $_SERVER['HTTP_REFERER'] but as it is set by the user agent (the browser), you cannot really trust it for anything important.

http://www.php.net/manual/en/reserved.variables.server.php

Fanis
A: 

Do you mean you simply want to know which URL people came from? Look at the Referrer header. But be aware this can be easily faked, so do not rely on it for security.

http://en.wikipedia.org/wiki/HTTP_referrer

James