//DECLARE YOUR COUNTER FILE
$counterFile="counter.txt";
//INCREMENT THE COUNTER
incrementCounter($counterFile);
//OUTPUT THE CURRENT COUNT
echo readCounter($counterFile);
function incrementCounter($counterFile)
{
$current=readCounter($counterFile);
$current++;
if(!$handle = fopen($counterFile, "w"))
{
return false;
}
else
{
if(fwrite($handle, $current) === FALSE)
{
return false;
}
}
fclose($handle);
return true;
}
function readCounter($counterFile)
{
$contents=file_get_contents($counterFile);
if(is_numeric((int)$contents))
{
return ((int)$contents);
}
else
{
return 0;
}
}
?>
Blogger templates
Blogger news
Blogroll
Archives
-
▼
2011
(212)
-
▼
July
(22)
- PHP Predefined variables
- For fixing jquery popups(light box, facebox) in a ...
- PHP switch statement
- Simple PHP Counter
- facebox not loading for content loaded from ajax/j...
- FREE PHP OPTION BR - ,
- Onkeypress Javascript Numeric and Decimal Validation
- PHP Development and website design services
- PHP include statement
- DateAdd
- Speed
- PHP History
- Step by step blog creation tutorials using PHP & M...
- some php related quick links
- Instruction separation in PHP
- Additional Costs
- Expressions in PHP
- Some Cool Date Function SafDate1V2 - SafDate5V2
- I was designed and programmed with a php website t...
- function with return in php
- Script Auto Reply SMS Gateway dengan PHP
- VBA databases connection
-
▼
July
(22)