|
|
| ||||||||||||||
![]() |

Domain Whois 1 0
Code Wizard, 12-30-2006domainwhois v1.0 will allow your users to perforum a whois on a given domain name.
this code could be extended and improved. If you change, Improve this code please notify me so i can take a look at the updated version you've made.
I also included my regulary style sheet for this code.
you can contact me through these options:
1. irc.freshmeat.net - I can be found, Idleing in #devnet or #PHP.
2. root@g33k.net - yes, I do always respond when getting emailed.
3. ICQ - ask for it when emailing me.
<?PHP
*/ domainwhois v1.0 - micke andersson, root@g33k.net
http://teksys.joshie.com/
*/
if ($domain)
{
if ($domain)
{
// first get the domain server from internic. you can also change the alternative
// whois server to something else that suits you.
$fp = fsockopen( "rs.internic.net", 43, &$errno, &$errstr, 10);
if (!$fp)
{
echo "$errstr ($errno)<br>
";
}
else
{
fputs($fp, "$domain
");
while(!feof($fp))
{
$buf = fgets($fp,128);
if (ereg( "Whois Server:", $buf))
{
$server = str_replace( "whois server: ", "", $buf);
$server = trim($server);
}
}
fclose($fp);
}
if ($server)
{
echo "<B>$domain is registered at $server:</B><BR>";
echo "<PRE>";
$fp = fsockopen($server, 43, &$errno, &$errstr, 10);
if(!$fp)
{
echo "could not open connection to $server on port 43.
";
echo "$errstr ($errno)<br>
";
}
else
{
fputs($fp, "$domain
");
while(!feof($fp))
{
echo fgets($fp,128);
}
fclose($fp);
}
}
else {
echo( "<b>$domain does not appear to be registered.</b><BR>");
}
echo ( "</PRE><BR>");
}
}
?>
<FORM ACTION=" <?PHP echo($PHP_SELF); ?>" METHOD="post">
This will find .com, .org, and .net domains<br>
domain: <INPUT TYPE="text" NAME="domain" SIZE="40" MAXLENGTH="100">
<INPUT TYPE=submit VALUE="Get Info!"><INPUT TYPE=reset VALUE="Reset">
</FORM>
|
|
Subscribe Now to receive new posts via Email as soon as they come out.
Post your comments
About us | Contact us | Privacy | Terms & Conditions | Affiliates | Advertise
Friday, November 21st, 2008 Page generated in 0.003 seconds | ![]() |

