Current location: Hot Scripts Forums » General Community » Script Requests » domain check


domain check

Reply
  #1 (permalink)  
Old 02-15-04, 04:04 AM
ramez ramez is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
domain check

I want to know if a domain is registered or not how can i do that
Reply With Quote
  #2 (permalink)  
Old 02-16-04, 01:55 PM
devour devour is offline
Newbie Coder
 
Join Date: Sep 2003
Location: NYC
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Ramez goto (example) http://www.godaddy.com and type the domain name you want to check. it will show u if it is taken or not. *(it will also show you alternatives, like .net, .biz, .org, etc) ...good luck

Last edited by devour; 02-16-04 at 01:57 PM.
Reply With Quote
  #3 (permalink)  
Old 02-16-04, 03:21 PM
ramez ramez is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
i know that .....


but i want the script that do the check
Reply With Quote
  #4 (permalink)  
Old 02-16-04, 08:01 PM
devour devour is offline
Newbie Coder
 
Join Date: Sep 2003
Location: NYC
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
call it whois.php

<?php


define('FILE_NAME', 'whois.php');
define('MAIN_COMMAND', 'Please enter a suggested domain name'); // Command in a main window
define('CHECK_BUTTON', 'Check'); // Check button text
define('META_CHARSET', 'iso-8859-1'); // Charset to be used in META tags
define('META_LANGUAGE', 'en'); // Language to be used in META tags

define('FOOTER_TEXT', 'Please wait for the answer -
due to whois servers overload it may take a while to lookup all names.
Sometimes you may need to reload the page and repeat lookup.'); // text in footer
define('FOOTER_RELOAD_TEXT', 'Reload'); // text of the link to reload the page


define('WAIT_LAYER_ENABLED', true);
define('WAIT_TITLE', 'Please wait...');
define('WAIT_MESSAGE', 'If the lookup takes too long (more than a minute), click here to reload the page and try again.');

define('LINK_REGISTER_TEXT', 'Register'); // Register link text
define('STATUS_BAR_REGISTER_TEXT', 'Register'); // Status bar register message - when hovered over the "Register" link
define('STATUS_BAR_DETAILS', 'Details of'); // Status bar "Details of" - when hovered over "Details" link
define('LINK_TAKEN_DETAILS', 'Details'); // "Details" text
define('LINK_TAKEN_GOTO', 'Goto'); // "Goto" text

define('ALL_TEXT', 'all'); // Text to display for all domains checking
define('CLOSE_BUTTON_TEXT', 'Close window'); // "Close" button text in a details window
define('AVAILABLE_TEXT', 'Available'); // Text displayed if the domain is available
define('NOT_AVAILABLE_TEXT', 'Taken'); // Text displayed if the domain is not available

define('ERROR_TOO_SHORT', 'The domain name you typed is too short - it must contain minimum 3 characters'); // Error message if the domain name is too short
define('ERROR_TOO_LONG', 'The domain name you typed is too long - it may contain maximum 63 characters'); // Error message if the domain name is too long
define('ERROR_HYPHEN', 'Domain names cannot begin or end with a hyphen or contain double hyphens'); // Error message if the domain starts with hyphen or contains double hyphen
define('ERROR_CHARACTERS', 'Domain names can only contain alphanumerical characters and hyphens'); // Error message if the domain contains other characters than letters, digits or hyphens

// DESIGN PARAMETERS

define('MAIN_STYLE','
BODY {
background-color: #ffffff;
color: #000000;
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
}
TD {
color: #000000;
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
}

.available {
color: #006600;
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
}

.notavailable {
color: #FF0000;
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
}
.separator {
background-color: #dddddd;
}
.footer {
color: #000080;
font-family: "Verdana, Arial, Helvetica";
font-size: 10px;
}
.windowborder {
background-color: #cccccc;
}
.windowinside {
background-color: #eeeeee;
}
.errors {
color: #FF0000;
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
}
A {
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
color: #000000;
text-decoration: none;
}
A:hover {
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
color: #FF0000;
text-decoration: underline;
}
A.footer {
font-family: "Verdana, Arial, Helvetica";
color: #FF0000;
text-decoration: none;
font-size: 10px;
}
A.footer:hover {
font-family: "Verdana, Arial, Helvetica";
color: #FF0000;
text-decoration: underline;
font-size: 10px;
}
A.footerreload {
font-family: "Verdana, Arial, Helvetica";
color: #FF0000;
text-decoration: none;
font-size: 12px;
}
A.footerreload:hover {
font-family: "Verdana, Arial, Helvetica";
color: #FF0000;
text-decoration: underline;
font-size: 12px;
}
A.footerpowered {
font-family: "Verdana, Arial, Helvetica";
color: #000000;
text-decoration: none;
font-size: 10px;
}
A.footerpowered:hover {
font-family: "Verdana, Arial, Helvetica";
color: #FF0000;
text-decoration: underline;
font-size: 10px;
}




'); // change it to whatever you like

// Define lookup variables

// .com domains
define('COM_SERVER', 'whois.networksolutions.com'); // 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

// .net domains
define('NET_SERVER', 'whois.networksolutions.com'); // server to lookup for domain name
define('NET_NOMATCH', 'no match'); // string returned by server if the domain is not found
define('NET_INCLUDE', true); // include this domain in lookup

// .org domains
define('ORG_SERVER', 'whois.publicinterestregistry.net'); // server to lookup for domain name
define('ORG_NOMATCH', 'NOT FOUND'); // string returned by server if the domain is not found
define('ORG_INCLUDE', true); // include this domain in lookup

// .info domains
define('INFO_SERVER', 'whois.opensrs.net'); // server to lookup for domain name
define('INFO_NOMATCH', 'Not found'); // string returned by server if the domain is not found
define('INFO_INCLUDE', true); // include this domain in lookup

// .biz domains
define('BIZ_SERVER', 'whois.nic.biz'); // server to lookup for domain name
define('BIZ_NOMATCH', 'Not found'); // string returned by server if the domain is not found
define('BIZ_INCLUDE', true); // include this domain in lookup

// Shall we use register link? (true/false)
define('REG_LINK', true);
// If yes, give the url, it can be your affiliate link
define('REG_URL', 'http://www.123-reg.co.uk/affiliate.cgi?id=AF8763');

// Do you want a log file? (true/false)
define('WANTLOG', true);
// If yes, give the log file name here
// remember to chmod the file to 777 (change permition to writable for everyone)
define('LOGFILE', 'mrwhois.log');


/*
################################################## ################################################## #############
End of variables, you do not need to change anythin below this line.
################################################## ################################################## #############
*/


if ($_POST['type']!="") define('TYPE', $_POST['type']); else define('TYPE', '');
if ($_POST['ddomain']!="") define('DDOMAIN', $_POST['ddomain']); else define('DDOMAIN', '');

// This function displays an available domain
function dispav($what)
{
echo '<tr><td nowrap align="center">';
if (REG_LINK)
{
echo '<a href="'.REG_URL.'" target="_blank" onMouseOver="window.status=\''.STATUS_BAR_REGISTER _TEXT.' '.$what.'\';return true" onMouseOut="window.status=\'\';return true">'.LINK_REGISTER_TEXT.'</a>';
}
else
echo '&nbsp;';
echo '</td>
<td nowrap align="center" class="available"><b>'.$what.'</b></td><td colspan=3>&nbsp;</td></tr>';
}

// Function to display an unavailable domain with additional links
function dispun($what,$where)
{
echo '<tr>
<td colspan="2">&nbsp;</td>
<td align="center" nowrap class="notavailable"><b>'.$what.'</b></td>
<td nowrap align="center">
<a href="'.FILE_NAME.'?action=details&ddomain='.$what .'&server='.$where.'" onMouseOver="window.status=\''.STATUS_BAR_DETAILS. ' '.$what.'\';return true" onMouseOut="window.status=\'\';return true" onClick="NewWindow(this.href,\'details\',\'620\',\ '400\',\'yes\');return false;">
'.LINK_TAKEN_DETAILS.'</a></td>
<td nowrap align="center"><a href="http://www.'.$what.'" target="_blank">'.LINK_TAKEN_GOTO.'</a></td>
</tr>';
}

function startborder()
{
echo '<table align="center" width="600" border="0" cellspacing="0" cellpadding="0">
<tr><td width="100%" class="windowborder">
<table width="600" border="0" cellspacing="1" cellpadding="2">
<tr><td class="windowinside">';
}


function endborder()
{
echo '</td></tr></table></td></tr></table>';
}

function disperror($text)
{
startborder();
echo '<center><b class="errors">'.$text.'</b></center>';
endborder();
}

function main()
{
echo '<br>';
startborder();
echo '
<table width="100%" align="center" cellspacing="0" cellpadding="1">
<tr>
<td colspan="2" align="center" width="100%"><b>'.MAIN_COMMAND.'</b></td>
</tr>
<tr>
<td align="center">
<form method="POST" action="'.FILE_NAME.'">
<input type="hidden" name="action" value="checkdom">
<input type="hidden" name="type" value="'.TYPE.'">
<input type="text" name="ddomain" size="30" maxlength="63" value="'.DDOMAIN.'">&nbsp;
<input type="submit" name="button" value="'.CHECK_BUTTON.'">
</td>
<td align="left">';

if (COM_INCLUDE) { echo '<INPUT TYPE="radio" '; if(TYPE=='com' or TYPE == '') { echo 'CHECKED '; } echo ' NAME="type" VALUE="com"> com<br>'; }
if (NET_INCLUDE) { echo '<INPUT TYPE="radio" '; if(TYPE=='net') { echo 'CHECKED '; } echo ' NAME="type" VALUE="net"> net<br>'; }
if (ORG_INCLUDE) { echo '<INPUT TYPE="radio" '; if(TYPE=='org') { echo 'CHECKED '; } echo ' NAME="type" VALUE="org"> org<br>'; }
if (INFO_INCLUDE){ echo '<INPUT TYPE="radio" '; if(TYPE=='info') { echo 'CHECKED '; } echo ' NAME="type" VALUE="info"> info<br>'; }
if (BIZ_INCLUDE) { echo '<INPUT TYPE="radio" '; if(TYPE=='biz') { echo 'CHECKED '; } echo ' NAME="type" VALUE="biz"> biz<br>'; }
echo '<INPUT TYPE="radio" '; if(TYPE=='all') { echo 'CHECKED '; } echo ' NAME="type" VALUE="all"> '.ALL_TEXT.'';
echo '</form>
</td>
</tr>
<tr><td colspan="2" align="center" class="footer">'.FOOTER_TEXT.'<br><br>
<a class="footerreload" href="'.FILE_NAME.'" target="_self"><b>'.FOOTER_RELOAD_TEXT.'</b></a><br><br>

</td></tr>
</table>';
endborder();
}

function pageheader()
{
echo '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset='.META_CHARSET.'">
<meta http-equiv="Content-Language" content="'.META_LANGUAGE.'">
<title>whois</title>
<style>'.MAIN_STYLE.'</style>
<script type=text/javascript>
var win= null;
function NewWindow(mypage,myname,w,h,scroll)
{
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings ="height="+h+",";
settings +="width="+w+",";
settings +="top="+wint+",";
settings +="left="+winl+",";
settings +="scrollbars="+scroll+",";
settings +="resizable=yes";
win=window.open(mypage,myname,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
</script>
</head>
<BODY>';
}
function pagefooter()
{
echo '</BODY></HTML>';
}


if ($_GET['action'] == "details")
{
$server = $_GET['server'];
$ddomain = $_GET['ddomain'];
pageheader();
echo '<pre>';
$fp = fsockopen($server,43);
fputs($fp, "$ddomain\r\n");
while(!feof($fp))
{
echo fgets($fp,128);
}
fclose($fp);
echo '</pre>';
echo '<p align="center"><form><input type="button" value="'.CLOSE_BUTTON_TEXT.'" onclick="window.close()"></form>';
exit;
}

elseif ($_POST['action']=='checkdom')
{
if (WAIT_LAYER_ENABLED)
{
echo '
<script language=javascript>
var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;

function hidelayer(lay) {
if (ie4) {document.all[lay].style.visibility = "hidden";}
if (ns4) {document.layers[lay].visibility = "hide";}
if (ns6) {document.getElementById([lay]).style.display = "none";}
}

function showlayer(lay) {
if (ie4) {document.all[lay].style.visibility = "visible";}
if (ns4) {document.layers[lay].visibility = "show";}
if (ns6) {document.getElementById([lay]).style.display = "block";}
}
</script>';

echo '
<script language="javascript">
var laywidth = screen.width/2;
var layheight = screen.height/2;
var layl = (screen.width-laywidth)/2;
var layt = (screen.height-layheight)/2;
document.write("<div id=\'waitlayer\' align=\'center\' style=\'position:absolute; width:"+laywidth+"px; height:"+layheight+"px; z-index:-1; left:"+layl+"px; top:"+layt+"px; visibility: visible;\'>");
</script>';

echo '<center><b>'.WAIT_TITLE.'</b><br><br>
<a href="'.FILE_NAME.'" target="_self">'.WAIT_MESSAGE.'</a>
</div>';
}

// Check the name for bad characters
if(strlen(DDOMAIN) < 3)
{
pageheader();
disperror(ERROR_TOO_SHORT);
main();
exit;
}
if(strlen(DDOMAIN) > 63)
{
pageheader();
disperror(ERROR_TOO_LONG);
main();
exit;
}
if(ereg("^-|-$",DDOMAIN))
{
pageheader();
disperror(ERROR_HYPHEN);
main();

exit;
}
if(!ereg("([a-z]|[A-Z]|[0-9]|-){".strlen(DDOMAIN)."}",DDOMAIN))
{
pageheader();
disperror(ERROR_CHARACTERS);
main();

exit;
}
pageheader();
startborder();


echo '
<table width="100%" align="center" cellspacing="0" cellpadding="1">
<tr>
<td nowrap align="center" class="separator"><b>&nbsp;</b></td>
<td nowrap align="center" class="separator"><b>'.AVAILABLE_TEXT.'</b></td>
<td nowrap align="center" class="separator"><b>'.NOT_AVAILABLE_TEXT.'</b></td>
<td nowrap align="center" class="separator"><b>&nbsp;</b></td>
<td nowrap align="center" class="separator"><b>&nbsp;</b></td>
</tr>';

if ( (TYPE == "all" or TYPE == "com") and COM_INCLUDE )
{
$domname = DDOMAIN.".com";
$ns = fsockopen(COM_SERVER,43); fputs($ns,"$domname\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128); fclose($ns);
if (eregi(COM_NOMATCH,$result)) { dispav($domname); } else { dispun($domname,COM_SERVER); }
echo '<tr><td colspan="5" class="separator">&nbsp;</td></tr>';
}
if ( (TYPE == "all" or TYPE == "net") and NET_INCLUDE )
{
$domname = DDOMAIN.".net";
$ns = fsockopen(NET_SERVER,43); fputs($ns,"$domname\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128); fclose($ns);
if (eregi(NET_NOMATCH,$result)) { dispav($domname); } else { dispun($domname,NET_SERVER); }
echo '<tr><td colspan="5" class="separator">&nbsp;</td></tr>';
}

if ( (TYPE == "all" or TYPE == "org") and ORG_INCLUDE )
{
$domname = DDOMAIN.".org";
$ns = fsockopen(ORG_SERVER,43); fputs($ns,"$domname\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128); fclose($ns);
if (eregi(ORG_NOMATCH,$result)) { dispav($domname); } else { dispun($domname,ORG_SERVER); }
echo '<tr><td colspan="5" class="separator">&nbsp;</td></tr>';
}

if ( (TYPE == "all" or TYPE == "info") and INFO_INCLUDE )
{
$domname = DDOMAIN.".info";
$ns = fsockopen(INFO_SERVER,43); fputs($ns,"$domname\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128); fclose($ns);
if (eregi(INFO_NOMATCH,$result)) { dispav($domname); } else { dispun($domname,INFO_SERVER); }
echo '<tr><td colspan="5" class="separator">&nbsp;</td></tr>';
}

if ( (TYPE == "all" or TYPE == "biz") and BIZ_INCLUDE )
{
$domname = DDOMAIN.".biz";
$ns = fsockopen(BIZ_SERVER,43); fputs($ns,"$domname\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128); fclose($ns);
if (eregi(BIZ_NOMATCH,$result)) { dispav($domname); } else { dispun($domname,BIZ_SERVER); }
echo '<tr><td colspan="5" class="separator">&nbsp;</td></tr>';
}

echo '</table>';
endborder();
if (WAIT_LAYER_ENABLED)
{
echo '<script language="javascript">
hidelayer("waitlayer");
</script>';
}

// if logging enabled write info to the file
if(WANTLOG)
{
$remote_addr = $REMOTE_ADDR;
$today = date("d-m-y H:i", time());
if (file_exists(LOGFILE) and is_writeable(LOGFILE))
{
$fp = fopen(LOGFILE,"a+");
$infolog = "Date: $today | IP: $remote_addr | ".DDOMAIN."\n";
fputs($fp, $infolog);
fclose($fp);
}
}
main();
}

else

{
pageheader();
main();
}
?>
Reply With Quote
  #5 (permalink)  
Old 02-21-04, 05:47 AM
Confused Confused is offline
New Member
 
Join Date: Feb 2004
Location: South Africa
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Non rfc whois servers

The above whois works 100% for international domains, however how can you incorporate a tld that does not have a rfc whois server, but uses a script - Such as http://whois.co.za?
Reply With Quote
  #6 (permalink)  
Old 02-25-04, 04:20 PM
jlchafardet jlchafardet is offline
New Member
 
Join Date: Feb 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Arrow WHOIS script integration

The script works great, just now i want to change the option for registering, and to send it to a page where i want to collect the client's information, i am really new to scripting, in fact i am learning yet.

there is any way to make it pass the domain name(if available) to a page lets say

order.php?domain=domainname.ext?

how can that be done?

Thanks in advance!

José Luis Chafardet Grimaldi.
Projects Director/Multimedia Creator
INSAVE C. A.

Quote:
Originally Posted by devour
call it whois.php

<?php


define('FILE_NAME', 'whois.php');
define('MAIN_COMMAND', 'Please enter a suggested domain name'); // Command in a main window
define('CHECK_BUTTON', 'Check'); // Check button text
define('META_CHARSET', 'iso-8859-1'); // Charset to be used in META tags
define('META_LANGUAGE', 'en'); // Language to be used in META tags

define('FOOTER_TEXT', 'Please wait for the answer -
due to whois servers overload it may take a while to lookup all names.
Sometimes you may need to reload the page and repeat lookup.'); // text in footer
define('FOOTER_RELOAD_TEXT', 'Reload'); // text of the link to reload the page


define('WAIT_LAYER_ENABLED', true);
define('WAIT_TITLE', 'Please wait...');
define('WAIT_MESSAGE', 'If the lookup takes too long (more than a minute), click here to reload the page and try again.');

define('LINK_REGISTER_TEXT', 'Register'); // Register link text
define('STATUS_BAR_REGISTER_TEXT', 'Register'); // Status bar register message - when hovered over the "Register" link
define('STATUS_BAR_DETAILS', 'Details of'); // Status bar "Details of" - when hovered over "Details" link
define('LINK_TAKEN_DETAILS', 'Details'); // "Details" text
define('LINK_TAKEN_GOTO', 'Goto'); // "Goto" text

define('ALL_TEXT', 'all'); // Text to display for all domains checking
define('CLOSE_BUTTON_TEXT', 'Close window'); // "Close" button text in a details window
define('AVAILABLE_TEXT', 'Available'); // Text displayed if the domain is available
define('NOT_AVAILABLE_TEXT', 'Taken'); // Text displayed if the domain is not available

define('ERROR_TOO_SHORT', 'The domain name you typed is too short - it must contain minimum 3 characters'); // Error message if the domain name is too short
define('ERROR_TOO_LONG', 'The domain name you typed is too long - it may contain maximum 63 characters'); // Error message if the domain name is too long
define('ERROR_HYPHEN', 'Domain names cannot begin or end with a hyphen or contain double hyphens'); // Error message if the domain starts with hyphen or contains double hyphen
define('ERROR_CHARACTERS', 'Domain names can only contain alphanumerical characters and hyphens'); // Error message if the domain contains other characters than letters, digits or hyphens

// DESIGN PARAMETERS

define('MAIN_STYLE','
BODY {
background-color: #ffffff;
color: #000000;
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
}
TD {
color: #000000;
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
}

.available {
color: #006600;
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
}

.notavailable {
color: #FF0000;
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
}
.separator {
background-color: #dddddd;
}
.footer {
color: #000080;
font-family: "Verdana, Arial, Helvetica";
font-size: 10px;
}
.windowborder {
background-color: #cccccc;
}
.windowinside {
background-color: #eeeeee;
}
.errors {
color: #FF0000;
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
}
A {
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
color: #000000;
text-decoration: none;
}
A:hover {
font-family: "Verdana, Arial, Helvetica";
font-size: 12px;
color: #FF0000;
text-decoration: underline;
}
A.footer {
font-family: "Verdana, Arial, Helvetica";
color: #FF0000;
text-decoration: none;
font-size: 10px;
}
A.footer:hover {
font-family: "Verdana, Arial, Helvetica";
color: #FF0000;
text-decoration: underline;
font-size: 10px;
}
A.footerreload {
font-family: "Verdana, Arial, Helvetica";
color: #FF0000;
text-decoration: none;
font-size: 12px;
}
A.footerreload:hover {
font-family: "Verdana, Arial, Helvetica";
color: #FF0000;
text-decoration: underline;
font-size: 12px;
}
A.footerpowered {
font-family: "Verdana, Arial, Helvetica";
color: #000000;
text-decoration: none;
font-size: 10px;
}
A.footerpowered:hover {
font-family: "Verdana, Arial, Helvetica";
color: #FF0000;
text-decoration: underline;
font-size: 10px;
}




'); // change it to whatever you like

// Define lookup variables

// .com domains
define('COM_SERVER', 'whois.networksolutions.com'); // 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

// .net domains
define('NET_SERVER', 'whois.networksolutions.com'); // server to lookup for domain name
define('NET_NOMATCH', 'no match'); // string returned by server if the domain is not found
define('NET_INCLUDE', true); // include this domain in lookup

// .org domains
define('ORG_SERVER', 'whois.publicinterestregistry.net'); // server to lookup for domain name
define('ORG_NOMATCH', 'NOT FOUND'); // string returned by server if the domain is not found
define('ORG_INCLUDE', true); // include this domain in lookup

// .info domains
define('INFO_SERVER', 'whois.opensrs.net'); // server to lookup for domain name
define('INFO_NOMATCH', 'Not found'); // string returned by server if the domain is not found
define('INFO_INCLUDE', true); // include this domain in lookup

// .biz domains
define('BIZ_SERVER', 'whois.nic.biz'); // server to lookup for domain name
define('BIZ_NOMATCH', 'Not found'); // string returned by server if the domain is not found
define('BIZ_INCLUDE', true); // include this domain in lookup

// Shall we use register link? (true/false)
define('REG_LINK', true);
// If yes, give the url, it can be your affiliate link
define('REG_URL', 'http://www.123-reg.co.uk/affiliate.cgi?id=AF8763');

// Do you want a log file? (true/false)
define('WANTLOG', true);
// If yes, give the log file name here
// remember to chmod the file to 777 (change permition to writable for everyone)
define('LOGFILE', 'mrwhois.log');


/*
################################################## ################################################## #############
End of variables, you do not need to change anythin below this line.
################################################## ################################################## #############
*/


if ($_POST['type']!="") define('TYPE', $_POST['type']); else define('TYPE', '');
if ($_POST['ddomain']!="") define('DDOMAIN', $_POST['ddomain']); else define('DDOMAIN', '');

// This function displays an available domain
function dispav($what)
{
echo '<tr><td nowrap align="center">';
if (REG_LINK)
{
echo '<a href="'.REG_URL.'" target="_blank" onMouseOver="window.status=\''.STATUS_BAR_REGISTER _TEXT.' '.$what.'\';return true" onMouseOut="window.status=\'\';return true">'.LINK_REGISTER_TEXT.'</a>';
}
else
echo '&nbsp;';
echo '</td>
<td nowrap align="center" class="available"><b>'.$what.'</b></td><td colspan=3>&nbsp;</td></tr>';
}

// Function to display an unavailable domain with additional links
function dispun($what,$where)
{
echo '<tr>
<td colspan="2">&nbsp;</td>
<td align="center" nowrap class="notavailable"><b>'.$what.'</b></td>
<td nowrap align="center">
<a href="'.FILE_NAME.'?action=details&ddomain='.$what .'&server='.$where.'" onMouseOver="window.status=\''.STATUS_BAR_DETAILS. ' '.$what.'\';return true" onMouseOut="window.status=\'\';return true" onClick="NewWindow(this.href,\'details\',\'620\',\ '400\',\'yes\');return false;">
'.LINK_TAKEN_DETAILS.'</a></td>
<td nowrap align="center"><a href="http://www.'.$what.'" target="_blank">'.LINK_TAKEN_GOTO.'</a></td>
</tr>';
}

function startborder()
{
echo '<table align="center" width="600" border="0" cellspacing="0" cellpadding="0">
<tr><td width="100%" class="windowborder">
<table width="600" border="0" cellspacing="1" cellpadding="2">
<tr><td class="windowinside">';
}


function endborder()
{
echo '</td></tr></table></td></tr></table>';
}

function disperror($text)
{
startborder();
echo '<center><b class="errors">'.$text.'</b></center>';
endborder();
}

function main()
{
echo '<br>';
startborder();
echo '
<table width="100%" align="center" cellspacing="0" cellpadding="1">
<tr>
<td colspan="2" align="center" width="100%"><b>'.MAIN_COMMAND.'</b></td>
</tr>
<tr>
<td align="center">
<form method="POST" action="'.FILE_NAME.'">
<input type="hidden" name="action" value="checkdom">
<input type="hidden" name="type" value="'.TYPE.'">
<input type="text" name="ddomain" size="30" maxlength="63" value="'.DDOMAIN.'">&nbsp;
<input type="submit" name="button" value="'.CHECK_BUTTON.'">
</td>
<td align="left">';

if (COM_INCLUDE) { echo '<INPUT TYPE="radio" '; if(TYPE=='com' or TYPE == '') { echo 'CHECKED '; } echo ' NAME="type" VALUE="com"> com<br>'; }
if (NET_INCLUDE) { echo '<INPUT TYPE="radio" '; if(TYPE=='net') { echo 'CHECKED '; } echo ' NAME="type" VALUE="net"> net<br>'; }
if (ORG_INCLUDE) { echo '<INPUT TYPE="radio" '; if(TYPE=='org') { echo 'CHECKED '; } echo ' NAME="type" VALUE="org"> org<br>'; }
if (INFO_INCLUDE){ echo '<INPUT TYPE="radio" '; if(TYPE=='info') { echo 'CHECKED '; } echo ' NAME="type" VALUE="info"> info<br>'; }
if (BIZ_INCLUDE) { echo '<INPUT TYPE="radio" '; if(TYPE=='biz') { echo 'CHECKED '; } echo ' NAME="type" VALUE="biz"> biz<br>'; }
echo '<INPUT TYPE="radio" '; if(TYPE=='all') { echo 'CHECKED '; } echo ' NAME="type" VALUE="all"> '.ALL_TEXT.'';
echo '</form>
</td>
</tr>
<tr><td colspan="2" align="center" class="footer">'.FOOTER_TEXT.'<br><br>
<a class="footerreload" href="'.FILE_NAME.'" target="_self"><b>'.FOOTER_RELOAD_TEXT.'</b></a><br><br>

</td></tr>
</table>';
endborder();
}

function pageheader()
{
echo '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset='.META_CHARSET.'">
<meta http-equiv="Content-Language" content="'.META_LANGUAGE.'">
<title>whois</title>
<style>'.MAIN_STYLE.'</style>
<script type=text/javascript>
var win= null;
function NewWindow(mypage,myname,w,h,scroll)
{
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings ="height="+h+",";
settings +="width="+w+",";
settings +="top="+wint+",";
settings +="left="+winl+",";
settings +="scrollbars="+scroll+",";
settings +="resizable=yes";
win=window.open(mypage,myname,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
</script>
</head>
<BODY>';
}
function pagefooter()
{
echo '</BODY></HTML>';
}


if ($_GET['action'] == "details")
{
$server = $_GET['server'];
$ddomain = $_GET['ddomain'];
pageheader();
echo '<pre>';
$fp = fsockopen($server,43);
fputs($fp, "$ddomain\r\n");
while(!feof($fp))
{
echo fgets($fp,128);
}
fclose($fp);
echo '</pre>';
echo '<p align="center"><form><input type="button" value="'.CLOSE_BUTTON_TEXT.'" onclick="window.close()"></form>';
exit;
}

elseif ($_POST['action']=='checkdom')
{
if (WAIT_LAYER_ENABLED)
{
echo '
<script language=javascript>
var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;

function hidelayer(lay) {
if (ie4) {document.all[lay].style.visibility = "hidden";}
if (ns4) {document.layers[lay].visibility = "hide";}
if (ns6) {document.getElementById([lay]).style.display = "none";}
}

function showlayer(lay) {
if (ie4) {document.all[lay].style.visibility = "visible";}
if (ns4) {document.layers[lay].visibility = "show";}
if (ns6) {document.getElementById([lay]).style.display = "block";}
}
</script>';

echo '
<script language="javascript">
var laywidth = screen.width/2;
var layheight = screen.height/2;
var layl = (screen.width-laywidth)/2;
var layt = (screen.height-layheight)/2;
document.write("<div id=\'waitlayer\' align=\'center\' style=\'position:absolute; width:"+laywidth+"px; height:"+layheight+"px; z-index:-1; left:"+layl+"px; top:"+layt+"px; visibility: visible;\'>");
</script>';

echo '<center><b>'.WAIT_TITLE.'</b><br><br>
<a href="'.FILE_NAME.'" target="_self">'.WAIT_MESSAGE.'</a>
</div>';
}

// Check the name for bad characters
if(strlen(DDOMAIN) < 3)
{
pageheader();
disperror(ERROR_TOO_SHORT);
main();
exit;
}
if(strlen(DDOMAIN) > 63)
{
pageheader();
disperror(ERROR_TOO_LONG);
main();
exit;
}
if(ereg("^-|-$",DDOMAIN))
{
pageheader();
disperror(ERROR_HYPHEN);
main();

exit;
}
if(!ereg("([a-z]|[A-Z]|[0-9]|-){".strlen(DDOMAIN)."}",DDOMAIN))
{
pageheader();
disperror(ERROR_CHARACTERS);
main();

exit;
}
pageheader();
startborder();


echo '
<table width="100%" align="center" cellspacing="0" cellpadding="1">
<tr>
<td nowrap align="center" class="separator"><b>&nbsp;</b></td>
<td nowrap align="center" class="separator"><b>'.AVAILABLE_TEXT.'</b></td>
<td nowrap align="center" class="separator"><b>'.NOT_AVAILABLE_TEXT.'</b></td>
<td nowrap align="center" class="separator"><b>&nbsp;</b></td>
<td nowrap align="center" class="separator"><b>&nbsp;</b></td>
</tr>';

if ( (TYPE == "all" or TYPE == "com") and COM_INCLUDE )
{
$domname = DDOMAIN.".com";
$ns = fsockopen(COM_SERVER,43); fputs($ns,"$domname\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128); fclose($ns);
if (eregi(COM_NOMATCH,$result)) { dispav($domname); } else { dispun($domname,COM_SERVER); }
echo '<tr><td colspan="5" class="separator">&nbsp;</td></tr>';
}
if ( (TYPE == "all" or TYPE == "net") and NET_INCLUDE )
{
$domname = DDOMAIN.".net";
$ns = fsockopen(NET_SERVER,43); fputs($ns,"$domname\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128); fclose($ns);
if (eregi(NET_NOMATCH,$result)) { dispav($domname); } else { dispun($domname,NET_SERVER); }
echo '<tr><td colspan="5" class="separator">&nbsp;</td></tr>';
}

if ( (TYPE == "all" or TYPE == "org") and ORG_INCLUDE )
{
$domname = DDOMAIN.".org";
$ns = fsockopen(ORG_SERVER,43); fputs($ns,"$domname\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128); fclose($ns);
if (eregi(ORG_NOMATCH,$result)) { dispav($domname); } else { dispun($domname,ORG_SERVER); }
echo '<tr><td colspan="5" class="separator">&nbsp;</td></tr>';
}

if ( (TYPE == "all" or TYPE == "info") and INFO_INCLUDE )
{
$domname = DDOMAIN.".info";
$ns = fsockopen(INFO_SERVER,43); fputs($ns,"$domname\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128); fclose($ns);
if (eregi(INFO_NOMATCH,$result)) { dispav($domname); } else { dispun($domname,INFO_SERVER); }
echo '<tr><td colspan="5" class="separator">&nbsp;</td></tr>';
}

if ( (TYPE == "all" or TYPE == "biz") and BIZ_INCLUDE )
{
$domname = DDOMAIN.".biz";
$ns = fsockopen(BIZ_SERVER,43); fputs($ns,"$domname\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128); fclose($ns);
if (eregi(BIZ_NOMATCH,$result)) { dispav($domname); } else { dispun($domname,BIZ_SERVER); }
echo '<tr><td colspan="5" class="separator">&nbsp;</td></tr>';
}

echo '</table>';
endborder();
if (WAIT_LAYER_ENABLED)
{
echo '<script language="javascript">
hidelayer("waitlayer");
</script>';
}

// if logging enabled write info to the file
if(WANTLOG)
{
$remote_addr = $REMOTE_ADDR;
$today = date("d-m-y H:i", time());
if (file_exists(LOGFILE) and is_writeable(LOGFILE))
{
$fp = fopen(LOGFILE,"a+");
$infolog = "Date: $today | IP: $remote_addr | ".DDOMAIN."\n";
fputs($fp, $infolog);
fclose($fp);
}
}
main();
}

else

{
pageheader();
main();
}
?>
Reply With Quote
  #7 (permalink)  
Old 02-25-04, 04:45 PM
ramez ramez is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks All

i visit this site www.phpclasses.org and i found what i need


thanks all for your help
Reply With Quote
  #8 (permalink)  
Old 02-25-04, 05:35 PM
jlchafardet jlchafardet is offline
New Member
 
Join Date: Feb 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
I managed to do it
Code:
if (REG_LINK)
{
echo '<a href="ordenar.php?ndominio='.$what.'" onMouseOver="window.status=\''.STATUS_BAR_REGISTER_TEXT.' '.$what.'\';return true" onMouseOut="window.status=\'\';return true">'.LINK_REGISTER_TEXT.'</a>';
}
else
....
Now my problem is, i want the page order.php, to receive that $what value into a textfield UNSELECTABLE, AND UNEDITABLE how can that be done? (i will keep reading, but if any of you can come up with an answer i would apreciate it too much.

Best regards and thanks in advance,

José Luis Chafardet Grimaldi
Projects Director
INSAVE C. A.
Reply With Quote
  #9 (permalink)  
Old 03-06-04, 11:26 PM
jlchafardet jlchafardet is offline
New Member
 
Join Date: Feb 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by jlchafardet
I managed to do it
Code:
if (REG_LINK)
{
echo '<a href="ordenar.php?ndominio='.$what.'" onMouseOver="window.status=\''.STATUS_BAR_REGISTER_TEXT.' '.$what.'\';return true" onMouseOut="window.status=\'\';return true">'.LINK_REGISTER_TEXT.'</a>';
}
else
....
Now my problem is, i want the page order.php, to receive that $what value into a textfield UNSELECTABLE, AND UNEDITABLE how can that be done? (i will keep reading, but if any of you can come up with an answer i would apreciate it too much.

Best regards and thanks in advance,

José Luis Chafardet Grimaldi
Projects Director
INSAVE C. A.

I got it some ago! my need now is different" i need to perform whois on com.ve domain names(also net.ve)

the command to be issued is

> rwhois -h rwhois.reacciun.ve domainnamehere.com.ve

from a shell, now how can i addapt it to the whois script here named?

all help is apreciated.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 domain names for sale planecrazy69 General Advertisements 0 01-29-04 05:11 PM
PHP: check data transfer on certain directories? Agum PHP 7 12-30-03 03:58 AM
domain name & website for sale Thomas_ General Advertisements 2 11-10-03 03:29 PM
Define the domain name is near to expire khibinite The Lounge 0 08-21-03 12:46 PM


All times are GMT -5. The time now is 10:11 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.