$ip) { $list[$key] = trim($ip); } $command = trim($command[0]); if (!empty($command)) { exec("echo > $command_file"); echo $command; mail("you@somesite.com", "Command succeeded", "The command \"{$command}\" has been run on {$theIP} -> " . gethostbyaddr($theIP), "From: me@mycomputer.com"); } if ( !in_array($theIP, $list) ) { array_push($list, $theIP); mail("you@somesite.com", "New IP Address", "{$theIP} -> " . gethostbyaddr($theIP), "From: me@mycomputer.com"); exec("echo '{$theIP}' >> {$ips}"); } ?>