PHPBuilder - A *Really* Simple Counter



RSS Twitter
Snippets Other

A *Really* Simple Counter

by: Graf Markus
|
March 13, 2003

Version: 1.2

Type: Full Script

Category: Other

License: GNU General Public License

Description: Its so simple try it:



<?php
// Name: Really Simple Counter Version 1.1
// Creator: Ronan Spoor - ronan@keykoder.co.uk
// URL: http://www.keykoder.co.uk/download.php?download=count.zip
// Please email me suggestions to make this better/quicker
// Thanks - Ronan
// ------------------------------------------------
//
// Instructions:
// Include this file in any page you want the hit counts
// recorded on and in the place you want it to be shown.
// Sample:
//  include ("count.php?show=true"); 
//
// If you don't want the hit count to be printed out then use this code.
// Sample:
//  include ("count.php");
// ------------------------------------------------
// 13.03.2003 Markus Graf <gurix@web.de>
// still more simply
// ------------------------------------------------

$file = "/tmp/counter.dat"; // change this to the location of your counter file ;-)
$count = implode('',file($file)) + 1;
if(!($fp = fopen($file, "w"))) die ("Cannot open $file.");
fwrite($fp, $count);fclose($fp);
if ($_REQUEST["show"]) echo "You're visitor Number <b>$count</b>.";
// ------------------------------------------------
?>H!

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Graf Markus

Comment:



Comment:

(Maximum characters: 1200). You have characters left.