<?php if($_SERVER['QUERY_STRING']){ $ip = getenv("REMOTE_ADDR"); $time = date("H:i:s"); $useragent = getenv("HTTP_USER_AGENT"); $dns = gethostbyaddr($ip); $fo = fopen("log.txt", "a"); fwrite($fo, "Query: ".$_SERVER['QUERY_STRING']." IP: ".$ip." DNS: ".$dns." UserAgent: ".$useragent." Time: ".$time."\n\n"); fclose($fo); } ?>