i'm about to translate a perl script to php.
i'm stuck with the following part of the script:
it checks within a db file if the client has already accessed this page before on the current day.
Code: Select all
# Check if user's IP is already in the daily log files.
# If it is, then set firsttoday to false (0).
if(-e "count.access.log")
{
open(LOG, "<count.access.log");
@ips = <LOG>;
close(LOG);
foreach $_ (@ips)
{
if ($_ eq $userip . "\n")
{
$firsttoday = 0;
}
}
}Code: Select all
$today = (Sun, Mon, Tue, Wed, Thu, Fri, Sat, Sun)ї(localtime)ї6]];
# Set to the current weekday.I'd appreciate your help!
Maximilian