top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to find out where a site visitor comes from?

0 votes
247 views
How to find out where a site visitor comes from?
posted Jun 30, 2014 by Amritpal Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

If the user has come to your site or a page on your site by following a link elsewhere, then that page should be made available through this variable:

$_SERVER["HTTP_REFERER"]

If there was a link on http://www.xyz.com to http://tech.queryhome.com/index.php and on that page you had:

$detect = $_SERVER["HTTP_REFERER"];
echo "I know where you came from! You clicked on a link from $detect !";

And then you will be able to tell your user where he/she has come from.

answer Jul 1, 2014 by Rahul Mahajan
Similar Questions
0 votes

I'm currently writing a paper on the evolution of PHP and web development/security as a whole.
One of the things I want to incorporate is snippets of source code to show how things have grown and advanced since the 90's

If anyone could help me out I would be much appreciated. All my attempts of trying to find it have turned up nothing :(

...