View Full Version : How can PHP know where visitor comes from ?
naruponk
03-11-2009, 06:02 AM
Hi,
Is there a way to know where visitor comes from ?
rogerke
03-11-2009, 06:51 AM
save this as a php file and then visit some other page first and then navigate to the newly created page. it should display the last page you visited before. or you could make another page with a link to this one.
<? echo $_SERVER['HTTP_REFERER']; ?>
either way, what you were looking for is
$_SERVER['HTTP_REFERER']
felgall
03-11-2009, 02:16 PM
Of course that is completely under the control of your visitors so they can have it set to whatever they like (although most who want to protect their privacy just turn the field off).
php8ox
03-15-2009, 04:14 PM
a more fun approach is to use GEOIP to locate geograhpically your visitors.
http://pear.php.net/package/Net_GeoIP/
http://www.maxmind.com/app/geoip_country
http://sourceforge.net/projects/geoip/
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.