john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

webcounter

<html>
in progress...

<?php

$ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
echo 'Your IP is: '.$ip;

$db_host='localhost';
$db_database='foupfeiffer_webcounter';
$db_username='foupfeiffer_dbuser';
$db_password='124578';

$connection = mysql_connect($db_host, $db_username, $db_password);
if (!$connection)
{   die ("Could not connect to the database: <br />". mysql_error());
}
else
{

    $db_select = mysql_select_db($db_database);
    if (!$db_select)
    {
        die ("Could not select the database: <br />". mysql_error());
    }
}

/*

INSERT INTO `pagehit` VALUES ($ip, '2004-05-05 23:56:25' );

/*
$dte = date("d/m/Y H:i:s");
echo $dte . "<br>";
*/

/*


$result = msql_query("SELECT * FROM pagehit WHERE id=1", $link);



if ($result)
{
echo "<b>Successfully Posted!</b><br>";

    while ($result_row = mysql_fetch_row($result))
    {
           echo $result_row[2] . '<br />';
    }



}
else
{   echo "<b>ERROR: unable to post.</b>";   }

*/

mysql_close($connection);

?>
</html>

  • « website 100 tips
  • Fileaccess.vbs »

Published

Feb 6, 2010

Category

web

~88 words

Tags

  • web 56
  • webcounter 1