Page 1 of 1

Linking

Posted: Sat Mar 08, 2003 5:40 am
by Raahul
hey i had a question, my site is accessed directly, or by some other sites and search engines. So when a person clicks on my site's link on a searchengine or a site, is it possible to know from where the user is comming from, if he click on my site from google.com it will record it in a text file that this person has com from this site. I think you understood what i mean.

Posted: Sat Mar 08, 2003 12:15 pm
by volka
take a look at http://www.php.net/manual/en/reserved.variables.php
the superglobal array $_SERVER has an element 'HTTP_REFERER' which contains the url of the page the user came from (if the client reports it).

Code: Select all

<?php echo $_SERVER['HTTP_REFERER']; ?>