If you have a website and you want to know when a visitor visits your website or if you want to know who is your website visitor or if you want to know your website visitor’s IP address, and more information about visitors, follow this tutorial
1 - If (main page is PHP) {
// add the code below into the php page
<?php $browser = $_SERVER['HTTP_USER_AGENT']; // visitor’s browser $ip = $_SERVER['REMOTE_ADDR']; // visitor’s IP Address $date = date("Y / m / d"); // date of visit $time = date("H : i : s"); // time of visit $subject = "I’m a Visitor"; // mail subject $email = "NRG@PRO "; // it’s not necessary to be a correct address $message = " browser = $browser \n ip = $ip \n date = $date \n time = $time"; mail( "Your Email address Here", "$subject", "$message", "From: $email" ); ?>
2 - } Else if (main page is not PHP) {
// add the code below into the main page
<p><?php $browser = $_SERVER['HTTP_USER_AGENT']; // visitor’s browser $ip = $_SERVER['REMOTE_ADDR']; // visitor’s IP Address $date = date("Y / m / d"); // date of visit $time = date("H : i : s"); // time of visit $subject = "I’m a Visitor"; // mail subject $email = "NRG@PRO "; // it’s not necessary to be a correct address $message = " browser = $browser \n ip = $ip \n date = $date \n time = $time"; mail( "Your Email address Here", "$subject", "$message", "From: $email" ); ?></p> }
Comment it and tell me you problems.
Have fun
Edited by Donna, 16 September 2005 - 08:06 PM.