Hello,
I'm trying to create a non-repeating counter. Gets the IP address, searches for it in the log file, if a match comes up it wont' count the hit. If no match, it will tell the script to increment the file.
I would like to use this format, since I'm familiar with it.
of
hits | IP address
4123|255.255.255.255
<?
$hitFile = '/path/to/hits.log';
So far I have this, which breaks up the | and prints the number of hits...
$count = file("$hitFile");
for ($i=0; $i<count($count); $i++) {
$display = explode("|", $count[$i]);
}
$hit = "$display[0]";
?>
somepage.phtml
<?echo $hit; ?>
Can you write me, usually a regular flat text file , no MySQL, how to search for an IP address