Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Markus Fensterer  >  Little Counter  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example script
Class: Little Counter
Keep track of user accesses to site pages in MySQL
Author: By
Last change:
Date: 9 years ago
Size: 682 bytes
 

Contents

Class file image Download
<?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");
?>