$newVisitorCountFile = fopen("newVisitorCount.txt","r");
$newVisitorCount = fgets($newVisitorCountFile,1000);
fclose($newVisitorCountFile);
$priorurl = $_SERVER['HTTP_REFERER']; // ie http://www.basisusa.com/
$parse = parse_url($priorurl);
$host = $parse['host']; // ie 'google.com'
if ($host != "www.basisusa.com") //(stripos($priorurl,"basisusa.com/index1.php") !== false)
{
$newVisitorCount=$newVisitorCount + 1 ;
// opens countlog.txt to change new hit number
$newVisitorCountFile = fopen("newVisitorCount.txt","w");
fwrite($newVisitorCountFile, $newVisitorCount);
fclose($newVisitorCountFile);
}
?>