Location: PHPKode > projects > Basic Announce > Basic Announce Version 4.0/Statistics_logger.php
//////////////////Statistitical Logger By Harry Smith///////////////////////////
//////////////////////////DONT EDIT THIS FILE///////////////////////////////////
///////////// COPYRIGHTED TO Bull Web Host Hosting Services And Harry Smith ////
</div id="configuration">
      DEFINE ('DB_USER', "$usr");// database username 
      DEFINE ('DB_PASSWORD', "$pswd");//database password 
      DEFINE ('DB_HOST', "$server");//database host, usually localhost 
      DEFINE ('DB_NAME', "$db");//and finally the database name 
      $dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error()); 
      @mysql_select_db (DB_NAME) OR die('Could not select the database: ' . mysql_error() ); 


$browser  =  $_SERVER['HTTP_USER_AGENT'];

$ip = $_SERVER['REMOTE_ADDR']; //Php retrieves the vistors IP address and stores it in the Var $ip

$visitor = gethostbyaddr($_SERVER['REMOTE_ADDR']); // Php retrives the visitors Host address and stores in the $visitor Var

$page = $_SERVER['PHP_SELF']; // Retrives page name

$logq = "INSERT INTO stats(ip, host, browser, page, recieved) VALUES ('$ip', '$visitor', '$browser', '$page', now())"; 

if(!$logr = @mysql_query($logq)); 
Return current item: Basic Announce