<?php $ip=$_SERVER['REMOTE_ADDR']; $handle = fopen("log.txt", 'a'); fwrite($handle, "$ip \r\n"); fclose($handle); ?>