note 101345 added to function.fputs
| From: | NeilMayfield at osu1 dot php dot net | Date: | Sat, 11 Dec 2010 18:47:58 +0000 |
| Subject: | note 101345 added to function.fputs | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-174797@lists.php.net to get a copy of this message | ||
This will create a visitor count for your webpage
<?php
$filename = 'sitevisitors.txt';
if (file_exists($filename))
{
$count = file('sitevisitors.txt');
$count[0] ++;
$fp = fopen("sitevisitors.txt", "w");
fputs ($fp, "$count[0]");
fclose ($fp);
echo $count[0];
}
else
{
$fh = fopen("sitevisitors.txt", "w");
if($fh==false)
die("unable to create file");
fputs ($fh, 1);
fclose ($fh);
$count = file('sitevisitors.txt');
echo $count[0];
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 71.193.248.243
----
Manual Page -- http://www.php.net/manual/en/function.fputs.php
Edit -- https://master.php.net/note/edit/101345
Del: integrated -- https://master.php.net/note/delete/101345/integrated
Del: useless -- https://master.php.net/note/delete/101345/useless
Del: bad code -- https://master.php.net/note/delete/101345/bad+code
Del: spam -- https://master.php.net/note/delete/101345/spam
Del: non-english -- https://master.php.net/note/delete/101345/non-english
Del: in docs -- https://master.php.net/note/delete/101345/in+docs
Del: other reasons-- https://master.php.net/note/delete/101345
Reject -- https://master.php.net/note/reject/101345
Search -- https://master.php.net/manage/user-notes.php