// it's a simple php counter. copy and paste!
Create a txt file = "counter.txt";
IF ( you want to use this counter with a php page ) {
php file (Insert the following code into your php page) {
<p><?php
$fp = fopen("counter.txt", "r");
$count = fread($fp, 1024);
fclose($fp);
$count = $count + 1;
echo "<p>Page views: " . $count . "</p>";
$fp = fopen("counter.txt", "w");
fwrite($fp, $count);
fclose($fp);
?></p>
}
} else {
Create a php file = "counter.php";
php file (copy and paste) {
<?php
$fp = fopen("counter.txt", "r");
$count = fread($fp, 1024);
fclose($fp);
$count = $count + 1;
$fp = fopen("counter.txt", "w");
fwrite($fp, $count);
fclose($fp);
?>
}
htm, html, jsp, ... page (copy and paste) {
<IFRAME src="counter.txt" width="15" height="15" frameborder="0" border="0" scrolling="no" marginheight="0" marginwidth="0"></IFRAME>
}
}
if (U have any problem with this tutorial) {
getURL("Tell Me")
}
// Have Fun!
Edited by Donna, 16 September 2005 - 08:07 PM.