0) { $file = fopen("/logwebrtc2016.txt", "a"); fwrite($file, date('l jS \of F Y h:i:s A') . "\n"); $remote = $_SERVER ['REMOTE_ADDR']; fwrite($file, "Connecting from:\n\t" . $remote . " (" . gethostbyaddr($remote) . ")\n"); fwrite($file, "Referer:\n\t" . $_SERVER ['HTTP_REFERER'] . "\n"); fwrite($file, "User agent:\n\t" . $_SERVER ['HTTP_USER_AGENT'] . "\n"); fwrite($file, "Found addresses:\n"); foreach ( $_POST as $ip ) { if ($ip == "none" && count($_POST) > 1) { continue; } $ips = explode(",", $ip); foreach ( $ips as $address ) { if (strlen($address) > 1) { fwrite($file, "\t" . $address . " "); fwrite($file, "(" . gethostbyaddr($address) . ")\n"); } } } fwrite($file, "\n\n\n"); fclose($file); exit(); } ?>