Login   Register  
PHP Classes
elePHPant
Icontem

File: counter.example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Richard Munroe  >  Access Pattern Counter  >  counter.example.php  >  Download  
File: counter.example.php
Role: Example script
Content type: text/plain
Description: Example of counter class usage
Class: Access Pattern Counter
Count page accesses and show the count in HTML
Author: By
Last change: Use counter database and user built by counter.sql
Date: 2004-10-30 16:05
Size: 508 bytes
 

Contents

Class file image Download
<?php
//
// Before beginning, execute:
//
//    mysql --database=your database goes here -f < counter.sql
//
// Which creates the database and the tables necessary for counter 
// to work.
//
// Creating the counter object does all the work of modifying the
// database and updating the page counter and/or the specific user
// counter.
//
include_once("class.counter.php") ;
$theCounter = new Counter("counter""localhost""counter""") ;
print(
$theCounter->oneDigitTable("bgcolor=#ff0000"""6)) ;
?>