Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

free whois script

Status
Not open for further replies.

Admin

Administrator
Staff member
Joined
Jun 14, 2004
Posts
11,089
Reaction score
979
If anyone is looking to make thier own WHOIS script page, this will give you a head start (requires PHP support from your web hosting):

Code:
<html>
< head>
< title>PHP WHOIS</title>
< meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
< /head>

<body>
< form name="form1" method="post" action="test.php">
<p>Enter Domain: 
<input name="domain" type="text" id="domain">
< /p>
<p>
<input type="submit" name="Submit" value="Check Whois">
< /p>
< /form>
< ?php
if(strlen($_POST['domain']) > 0){

// Create Whois Server Array
$server['nic'] = "whois.nic.uk:No match for";
$server['crsnic'] = "whois.crsnic.net:No match for";

// Create Extension Array
$domainInfo['.co.uk'] = "nic";
$domainInfo['.org.uk'] = "nic";
$domainInfo['.ltd.uk'] = "nic";
$domainInfo['.plc.uk'] = "nic";
$domainInfo['.com'] = "crsnic";
$domainInfo['.net'] = "crsnic";
$domainInfo['.org'] = "crsnic";

// Separate Domain and Extension
$fullDomain = $_POST['domain'];
$parts = explode(".",$fullDomain);
$domain = $parts[0];
$extension = str_replace($domain,"",$fullDomain);

// Find Whois Server and Text to Match
$tempServer = $domainInfo[$extension];
$whoisDetails = $server[$tempServer];
$splitWhois = explode(":",$whoisDetails);
$whoisServer = $splitWhois[0];
$textToMatch = $splitWhois[1];

// Query WHOIS Server for Domain
$port = 43;
$domainName = $domain . $extension . "\n";
$fp = fsockopen($whoisServer,43);
fputs($fp, $domainName);
while (!feof($fp))
$whoisRecord .= fgets($fp,128);
fclose($fp);
$whoisRecord = str_replace("\n","<br>",$whoisRecord);

// Check Whether Domain is Registered or not
if(strstr($whoisRecord, $textToMatch) != FALSE){
$registered = 0;
} else {
$registered = 1;
}

// Output Results
if($registered==0){
echo $domain . $extension . " is not registered.";
} else {
echo $domain . $extension . " is registered. WHOIS Details:";
echo "<br><br>";
echo $whoisRecord;
}
}
?>
< /body>
< /html>
 
Status
Not open for further replies.

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Members online

Premium Members

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Systreg AcornBot:
    Systreg has left the room.
      Systreg AcornBot: Systreg has left the room.
      Top Bottom