PHP Classes

File: counter.example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  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: 10 years ago
Size: 508 bytes


Class file image Download
// 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", "") ;
$theCounter->oneDigitTable("bgcolor=#ff0000", "", 6)) ;