I have the rest of the code all I need now is the location help is much appreciated. <?php $ipz0r= $_SERVER[REMOTE_ADDR]; $pagez0r = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}"; $referrerz0r = $_SERVER['HTTP_REFERER']; $datetimez0r = date('l jS \of F Y \a\t h:i:s A'); $useragentz0r = $_SERVER['HTTP_USER_AGENT']; $remotehostz0r = @getHostByAddr($ipz0r); $bodyz0r = "IP: " . $ipz0r . "\n\nPage: " . $pagez0r . "\n\nDate: ". $datetimez0r . "\n\nUser Agent: " . $useragentz0r . "\n\nRemote Host: " . $remotehostz0r; mail("@gmail.com","CPCT RE", $bodyz0r); echo ""; ?>
There is a special php module you need to install on the server: http://www.maxmind.com/app/php http://www.videochat-scripts.com/install-geoip-php-extension/ http://php.net/manual/en/book.geoip.php
The best way to show the state and city is to use an IP Address lookup api service. All you have to do is to request an API key, receive all the info by email and add the code to your website.