PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How can I find out where a site visitor comes from?


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"]

So imagine there was a link on http://www.mysite.com to http://www.yoursite.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 didn't you!";

... then you will be able to tell your user where they came from.

Comment on this Question and Answer >>>

ASK A QUESTION

More website PHP Questions

How can I use sessions in PHP?

How can I access information sent through POST on a form?

THIS IS THE CURRENT CODE: ---------------------------------

how can i add a chatbox to my site?

how to get gmail inboxmessages in php using username and password



Custom Search