Location: PHPKode > scripts > Little Counter > little-counter/example.php
<?php
 include("littleCounter.php");
 include("database.inc.php");
 $counter = new littleCounter;
 $counter->dbhost = $database['host'];
 $counter->dbuser = $database['user'];
 $counter->dbpwd = $database['pwd'];
 $counter->dbdatabase = $database['db'];
 $counter->dbtable = $database['tablename'];
 $counter->onlinetime = "300";
 $counter->connect_to_db();
 $counter->insert_new_hit();
 echo "Hits: ";
 echo $counter->show_counter("hits");
 echo "<br />Counter: ";
 echo $counter->show_counter("total");
 echo "<br />Online: ";
 echo $counter->show_counter("online");
 echo "<br />Hits of you (last 24 hours): ";
 echo $counter->show_counter("hits_of_user");
?>
Return current item: Little Counter