// when included inside <select name="tool"> on a html file .. if ($tool=="listtools") { while (list($key, $val) = each($tools)) { print " <option value="".$key."">".$val."</option>n"; } exit; }
// print appropriate html header print "<html>"; if ($tool) { print "<head><title>".$tool." for ".$query."</title></head>n"; print "<body>n<h3>".$tool." for ".$query." ..</h3>n"; } else { print "<head><title>".$app_name."</title></head>n"; print "<body>n<h3>".$app_name."</h3>n"; }
// check what tool they want to use and do what is necessary switch($tool) { case "finger": if ($query) { print "<pre>n"; finger($server, $query); print "</pre>"; } else { ?>
case "whois": if ($query) { print "<pre>n"; whois($server,$query); print "</pre>"; } else { ?>
<!-- <ul> to look up a nic handle, host name, or registrant, use one of the keywords below:<br> <li>to search by nic handle (or contact), type "handle wa3509"</li><br> <li>to search by name, type "name lastname, firstname" </li><br> <li>to search by company name, type "name the sample corporation" </li><br> <li>to search by domain name, type "example.com" </li><br> <li>to search by ip address, type "host 121.23.2.7" </li><br> <li>to search by host or nameserver name, type "host ns1.worldnic.com" </li><br> (examples are from networksolutions.com) </ul> -->
<form action="<?php echo($php_self. "?tool=".$tool); ?>" method="post"> this will find .com, .org, and .net domains<br> server : <input type="text" name="server" value="rs.internic.net"> <br> query : <input type="text" name="query" size="40" maxlength="100"> <br> <input type="submit" value="<?php echo $tools[$tool]; ?>"> </form>