Simple Php Whois Script Look Up Domain Names Form Search Easy Whois


Simple Php Whois Script Look Up Domain Names Form Search Easy Whois
  Forums Index
      » PHP Forums
        » » simple php whois script look up domain names form search easy whois



Simple Php Whois Script Look Up Domain Names Form Search Easy Whois
Post Description:
Post Tags: simple, php, whois, script, look, up, domain, names, form, search, easy, whois, free php support, php scripts, php questions, php answers, programming, codes, scripts
This Post Has Been Viewed 1589 Times Since Mon Jun 18, 2007 8:37 am Posted By hostman with 3 replies
Simple Php Whois Script Look Up Domain Names Form Search Easy Whois
a long time a go, i always wondered how those websites where able to find a domain name. you know what i am talking about, if you go to any of the web hosting sites, you will se a search form with a text bar to enter a domain name and when you type the name of the domain name and then the type of domain name lik .com or .net, it will tell you if its taken or if its available.

well, thanks to webune.com who is my web hosting company. but webune is more than just web hosting, they have helped me with my dedicated server for all my websites and now they've helped me create a script which looks up a domain name.

here is the script:

<h1>Simple WHOIS Script by <a href="http://www.webune.com">Webune.com</a></h1>
<hr>
<?
if ($_POST['type']!="") define('TYPE', $_POST['type']); else define('TYPE', '');
if ($_POST['domain']!="") define('DOMAIN', $_POST['domain']); else define('DOMAIN', '');
// .com domains
define('COM_SERVER', "rs.internic.net"); // server to lookup for domain name
define('COM_NOMATCH', "No match"); // string returned by server if the domain is not found
define('COM_INCLUDE', true); // include this domain in lookup


function search_form($error)
{
echo $error;
?>
<form name="form1" method="post" action="">
Enter Domain Name:
<input type="text" name="domain">
<input name="Search" type="submit" id="Search" value="Search">
</form>
<?
}
if($_REQUEST['Search'])
{
if(strlen(DOMAIN) < 3)
{
$error .= "ERROR: Please Enter Domain Name<br>";
}
else
{
if(!ereg("([a-z]|[A-Z]|[0-9]|-){".strlen(DOMAIN)."}",DOMAIN))
{
$error .= "Domain names can only contain alphanumerical characters and hyphens<br>";
}
}
if(strlen(DOMAIN) > 63)
{
$error .= "domain too long<br>";
}
if(ereg("^-|-$",DOMAIN))
{
$error .= "Domain names cannot begin or end with a hyphen or contain double hyphens<br>";
}

if($error)
{
search_form($error);
}
else
{
$domname = DOMAIN;
$ns = fsockopen(COM_SERVER,43); fputs($ns,"$domnamern");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128); fclose($ns);
if (eregi(COM_NOMATCH,$result)) { $available=true; } else { $available=false;}
if($available)
{
echo "this domain is available";
}
else
{
echo "this domain is registered";
}

}




}
else
{
search_form($error);
}
?>
<hr>
<div align="center">
<p align="left">This is a simple whois lookup script, this is just to give you an idea of how you can create your own who is script. you can make it as fancy as you want, but i hope this is to get you started. if you need PHP web hosting for your website or need a reliable dedicated server check out <a href="http://www.webune.com">webune.com</a> </p>
<p>PHP Hosting by <a href="http://www.webune.com">Webune.com </a></p>
</div>


Leave Your Comments
* Your Name

  * Your Email Address (Will Not Be Published)

* Your Comments


Add Picture To Comments
Yes No             upload
Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

     




Comments and replies About Simple Php Whois Script Look Up Domain Names Form Search Easy Whois






:: 1 :: #7079 - Reply By nice On Mon Jun 18, 2007 8:40 am
this is a cool whois script php created for whois script lookups mirc whois script whois how where you able to do this, i've been searching for something like this.


cgi script whois scripts whois script free whois script nsscript javascript whois dns script perl whois ip script domain script script domain name script dns script whois cgi area dns scripts script to change dns whois tutorial script change dns dynamic dns script perl whois parse dns update script perl net whois star finger news script reverse dns script cgi bin whois finger script script to change dns settings dns suffix script postal usps reverse area javascript reverse are airport sic cpt area prefix free phone area country cage canada postal us area exchange verizon area area and prefix javascript array by city ceeb canadian postal free area javascript table telephone area dns tutorial county county by international post aera canada icd 9 post office by address javascript dns bar swift postal user tutorial perl nsinternational wallpaperama.com area naics canadian icd9 middle finger text tutorial nstutorial area and exchange 4 diagnosis us area us postal service perl dns county neopets user tutorial international postal postal service clli perl dns error school by city 9 digit ups perl vbscript nsaddress us post office by area us postal city color uk postal zipe canada post postal neopets tutorial scac us postal dns hcpcs fips sip map procedure free cpt phone icd harmonized neopets user vbscript dns web service exchange canada area aip area map area city penal area by city phone number area perl hash rea point by street text scripting dns imprint vbscript dns high school wallpaperama united states zio vbscript reverse postal text message middle finger cursor paint college ip ets remote unit identification ndc reverse country neopets radius pill middle finger in text cell phone area college ceeb finger text aread html color state uk post united states postal service zi hts state trigger finger tutorial by state php prefix national batch engine pin act excel text multiple mexico drug perl net dns area by number xip full area location england postal nj tariff melissa data area usps postal plus 4 ara us finger
:: 2 :: #13295 - Reply By wallpaperama On Mon Jul 30, 2007 8:43 pm
i modified this script, this one works! just leave the example.com
<h1>Whois PHP Script Example by <a href="http://www.webune.com">Webune.com</a></h1>
<?
if ($_POST['type']!="") define('TYPE', $_POST['type']); else define('TYPE', '');
if ($_POST['domain']!="") define('DOMAIN', $_POST['domain']); else define('DOMAIN', '');
// .com domains
define('COM_SERVER', "rs.internic.net"); // server to lookup for domain name
define('COM_NOMATCH', "No match"); // string returned by server if the domain is not found
define('COM_INCLUDE', true); // include this domain in lookup

function search_form($error){
echo $error;
?>
<form name="form1" method="post" action="">
Enter Domain Name:
<input name="domain" type="text" value="example.com">
<input name="Search" type="submit" id="Search" value="Search">
</form>
<?
}

if($_REQUEST['Search']){

if($error){
search_form($error);
}
else{

$ns = fsockopen('rs.internic.net',43);
fputs($ns, $_POST['domain']."\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128);
fclose($ns);
if (eregi('No match',$result)) {
echo $_POST['domain'].' is available<h1 align="center"><a href="http://www.webune.com">Continue &gt;&gt; </a></h1>';
}
else {
echo $_POST['domain'].' is NOT available<h1 align="center"><a href="http://www.webune.com">Continue &gt;&gt; </a></h1>';
}
}
}
else{
search_form($error);
}
?>

:: 3 :: #68940 - Reply By Oliver Davenport On Mon Sep 01, 2008 5:46 am
nice!!

would you like us to leave the credits in ?