It works fine, but I have to manually wipe it each month.
Is there an easy way (without modules) to zero out the file on the first day of the month 01 ($mday) only once! Which means it has to ignore the $mday of 01 after the first time. I can zero the file okay, but from there is beyond my skill.
Then every visit to a page is added as normal until the next month 02 ($mday) and repeats it. Without a cron job.
Expand|Select|Wrap|Line Numbers
- $pagelog="visits.txt";
- ($sec,$min,$hour,$mday,$mon,$year) = gmtime();
- $year = $year + 1900; $mon = $mon + 1;
- if ($mon<10) {$mon="0$mon";}
- if ($mday<10) {$mday="0$mday";}
- if ($mday == 01)
- {print qq~<b>$mday</b>~;
- open VN, ">$pagelog"; close VN;}
- else {
- print qq~<b>Log the next visitor</b>~;
- }
Or am I approaching this the wrong way?
Thanks in advance for any help.