joanne
Terugkerende gebruiker
- Lid geworden
- 31 mrt 2001
- Berichten
- 1.300
Een teller, alleen hoe zorg ik er nu voor dat mijn 'bezoek' niet meegeteld wordt, m.a.w. dat het een unieke teller wordt?
<?php
//this is our text file if you create a different named file change the script below to reflect this
$counter_file = ("counter.txt");
//now we open the file
$visits = file($counter_file);
//this increments the counter value by 1
$visits[0]++;
//now we will open the counter file for writing "w"
$fp = fopen($counter_file , "w");
//put the new count value into the counter file
fputs($fp , "$visits[0]");
//close the file
fclose($fp);
//display the count
echo "There have been $visits[0] visitors so far";
?>
<?php
//this is our text file if you create a different named file change the script below to reflect this
$counter_file = ("counter.txt");
//now we open the file
$visits = file($counter_file);
//this increments the counter value by 1
$visits[0]++;
//now we will open the counter file for writing "w"
$fp = fopen($counter_file , "w");
//put the new count value into the counter file
fputs($fp , "$visits[0]");
//close the file
fclose($fp);
//display the count
echo "There have been $visits[0] visitors so far";
?>