What i want is a webpage that only can be viewed once per ip.. This script doesnt work for me can someone please fix it or help me rewrite this ? ??? ::) [code] <? $key = $_SERVER['REMOTE_ADDR']; //load file into $fc array $fc=file("some.txt"); //open same file and use "w" to clear file $f=fopen("some.txt","w"); //loop through array using foreach foreach($fc as $line) { if (!strstr($line,$key)) //look for $key in each line fputs($f,$line); //place $line back in file header("Location:http://www.google.com"); } fclose($f); $text = "\n$key"; $file = fopen('some.txt', 'a'); fwrite($file,$text); fclose($file); echo "Hello World"; ?>[/code]