If you want it to keep track of IP's why not have it hold it as an array in a separate file.

PHP Code:
<?php

define
('COUNTER_FILE','counter.txt'); // define counter file
define('IP_FILE''ip_log.txt'); // define ip log

$ips file_get_contents(IP_FILE); // get file content as a variable

$visitCount file_get_contents(COUNTER_FILE); // get page views

$seperator " "// defaults to a space but change as you see fit

$ipRanges explode($seperator$ips); // transform into an array

$currentUsersIp $_SERVER['REMOTE_ADDR']; // get current IP


if (!in_array($currentUsersIp$ipRanges// check if the value is not in an array
{
 
// add it to array, save array it to a file and update file counter

$visitCount $visitCount 1// add one to the current visitor file
file_put_contents(COUNTER_FILE$visitCount); // write it to file
file_put_contents(IP_FILE$seperator $currentUsersIpFILE_APPEND); // add ip to ip log 
 
echo file_get_contents(COUNTER_FILE); // get visits including this new visit

}
else 
// is in array dont count it as a visit
{
// show current page views

echo $visitCount;
}

?>
Its not a complete solution but should work just fine if you want views to be unique based on ips.

Last edited by pein87; 16Sep2010 at 13:20..