Buy Sell Discuss UK Domain Names at AcornDomains.co.uk

Today's Drop Dates are: 19-02-2012 or 26-02-2012   All times are GMT. The time now is 01:49:05 PM.
Domain Name Sales Domain Software Calculate UK Domain Drop Dates Domain Registration NameDrive Domain Parking Subscribe to our Domains For Sale newsletter
Go Back   Domain Forum Acorn Domains Buy Sell Auction UK Domains > Website Design and Promotion > Website Design
Connect with Facebook

Website Design Discuss web design

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 06-04-2005, 09:20:20 AM     #1 (permalink)
Administrator
 
admin's Avatar
 
Join Date: Jun 2004
Posts: 8,601
admin has disabled reputation

Post free whois script

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>
admin is offline  
Closed Thread



Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Domain Sponsor 2


All times are GMT. The time now is 01:49:05 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0 RC 2
All content on Acorn Domains is member generated and is not moderated before posting. All content is viewed and used by you at your own risk and AD does not warrant the accuracy or reliability of any of the information. The views expressed are those of the individual contributors and not necessarily those of AD. Please contact us to report any issues or send a PM to "Admin".