Hello all,
I have googled this and there are resources out there...but im not too sure why they are not working for me.
When I hit Submit, I want the results to open up in a new window maybe 400 by 600. I have tried numerous things, but they dont like me. Can anyone suggest a solution?
Thanks.
<?php
// Whois.php
// Retrieves whois information about domain names
// Peter Loh
$whois = array (
".com" => array ("type" => "Commercial", "server" => "whois.internic.net"),
".net" => array ("type" => "Network", "server" => "whois.internic.net"),
".org" => array ("type" => "Organisation", "server" => "whois.internic.net"),
".edu" => array ("type" => "Education", "server" => "whois.internic.net"),
".gov" => array ("type" => "Government", "server" => "whois.nic.gov"),
".biz" => array ("type" => "Business", "server" => "whois.pacificroot.com"),
".name" => array ("type" => "Name", "server" => "whois.nic.name"),
".info" => array ("type" => "Information", "server" => "whois.afilias.info"),
".au" => array ("type" => "Australia", "server" => "whois.ausregistry.net"),
".ca" => array ("type" => "Canada", "server" => "whois.cira.ca"),
".de" => array ("type" => "Germany", "server" => "whois.denic.de"),
".dk" => array ("type" => "Denmark", "server" => "whois.dk-hostmaster.dk"),
".fr" => array ("type" => "France", "server" => "whois.nic.fr"),
".ru" => array ("type" => "Russia", "server" => "whois.ripn.net"),
".uk" => array ("type" => "United Kingdom", "server" => "whois.nic.uk"),
".us" => array ("type" => "United States", "server" => "whois.us"),
);
echo "<HTML>\n";
echo "<HEAD>\n";
echo " <TITLE>Whois</TITLE>\n";
echo "</HEAD>\n\n";
echo "<BODY>\n";
echo ' <FORM METHOD="POST" ACTION="', "{$PHP_SELF}", '" >', "\n";
echo ' Domain: <INPUT TYPE="text" NAME="domain" VALUE="', "{$domain}", '" SIZE="30">', "\n";
echo ' <INPUT TYPE="submit" VALUE="Lookup">', "\n";
echo ' </FORM>';
if (!empty ($domain))
{
echo '
', "\n", '<HR NOSHADE>', "\n";
$tld = explode (".", $domain);
$tld = "." . $tld[count($tld)-1];
if (!array_key_exists ($tld, $whois))
{
die ("This script currently does not support the {$tld} TLD.");
}
ob_start();
system ("whois -h {$whois[$tld]["server"]} {$domain}");
$whoisdata = ob_get_contents();
ob_end_clean();
print_r (eregi_replace ("\n", "
\n", $whoisdata));
}
echo ' </BODY>', "\n", '</HTML>', "\n";
?>
I have googled this and there are resources out there...but im not too sure why they are not working for me.
When I hit Submit, I want the results to open up in a new window maybe 400 by 600. I have tried numerous things, but they dont like me. Can anyone suggest a solution?
Thanks.
<?php
// Whois.php
// Retrieves whois information about domain names
// Peter Loh
$whois = array (
".com" => array ("type" => "Commercial", "server" => "whois.internic.net"),
".net" => array ("type" => "Network", "server" => "whois.internic.net"),
".org" => array ("type" => "Organisation", "server" => "whois.internic.net"),
".edu" => array ("type" => "Education", "server" => "whois.internic.net"),
".gov" => array ("type" => "Government", "server" => "whois.nic.gov"),
".biz" => array ("type" => "Business", "server" => "whois.pacificroot.com"),
".name" => array ("type" => "Name", "server" => "whois.nic.name"),
".info" => array ("type" => "Information", "server" => "whois.afilias.info"),
".au" => array ("type" => "Australia", "server" => "whois.ausregistry.net"),
".ca" => array ("type" => "Canada", "server" => "whois.cira.ca"),
".de" => array ("type" => "Germany", "server" => "whois.denic.de"),
".dk" => array ("type" => "Denmark", "server" => "whois.dk-hostmaster.dk"),
".fr" => array ("type" => "France", "server" => "whois.nic.fr"),
".ru" => array ("type" => "Russia", "server" => "whois.ripn.net"),
".uk" => array ("type" => "United Kingdom", "server" => "whois.nic.uk"),
".us" => array ("type" => "United States", "server" => "whois.us"),
);
echo "<HTML>\n";
echo "<HEAD>\n";
echo " <TITLE>Whois</TITLE>\n";
echo "</HEAD>\n\n";
echo "<BODY>\n";
echo ' <FORM METHOD="POST" ACTION="', "{$PHP_SELF}", '" >', "\n";
echo ' Domain: <INPUT TYPE="text" NAME="domain" VALUE="', "{$domain}", '" SIZE="30">', "\n";
echo ' <INPUT TYPE="submit" VALUE="Lookup">', "\n";
echo ' </FORM>';
if (!empty ($domain))
{
echo '
', "\n", '<HR NOSHADE>', "\n";
$tld = explode (".", $domain);
$tld = "." . $tld[count($tld)-1];
if (!array_key_exists ($tld, $whois))
{
die ("This script currently does not support the {$tld} TLD.");
}
ob_start();
system ("whois -h {$whois[$tld]["server"]} {$domain}");
$whoisdata = ob_get_contents();
ob_end_clean();
print_r (eregi_replace ("\n", "
\n", $whoisdata));
}
echo ' </BODY>', "\n", '</HTML>', "\n";
?>