Linking

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Raahul
Forum Newbie
Posts: 6
Joined: Sat Mar 08, 2003 5:40 am

Linking

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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']; ?>
Post Reply