Recent Additions:

Creating a Simple Web Advertisement

Toon Site Navigation Header

Creating Cool Celebrity Wallpapers

Shopping Site Animated Banner

Designing a Cake Shop Logo

Creating a Girlie Smiley

Drawing a Cartoon Horse

Colorful Beads Text Effect

XP Style Wind Mill Icon

Water Ripples Navigation Header

Shopping Mall Logo

Creating a Lovefool Smiley

Animated No Smoking Sign

Creating and Animating Incense Sticks

Creating a Futuristic Logo

3D Leather Text Effect

Changing Calendar Dates

Logo with Iconic Headphones

Animating a Dolphin Diving Into the Water

Creating Diamond Earrings

Animated Night to Day Effect With Rising Sun

 

Simple Counter


The way the counter works:
- We create a text file to hold the count.
- Then we read the text file.
- Increment the count.
- Open the text file.
- store the new count and then close the text file.
Seems hard but actually very easy!


Create a text file, name it counter.txt

<?php
$count
= ("counter.txt");
//now this is where we open the file
$visits = file($count);
//this adds 1 hit
$visits[0]++;
//Now open the counter
$fp = fopen($count , "w");
//put the new count value into the txt file
fputs($fp , "$visits[0]");
//close the file
fclose($fp);
//display the count
echo $visits[0];
?>
Save as counter.php or anything you wish

Now just upload the counter.php and counter.txt to the same dir, and command the txt file to 777
then this hould work perfect!

To add the counter to anywhere on your site just add the following code
<?php
include ("counter.php");
?>