$ip = $_SERVER["REMOTE_ADDR"]."\n"; $file = fopen("ips.txt","a+"); fwrite($file,$ip);