آهان ...
میشه whois ...
خوب این کد میتونه کمکتون کنه ...
خودتون باید یه جوری اونچیزی که میخواید رو ازش در بیارید ...
فایل رو با نام whois ذخیره کنید ...
[php]
<?php
define('file_name', 'whois.php');
// language settings
define('page_title_meta', 'phpselect'); // title to be used in meta tag within header
define('powered_by', 'powered by phpselect'); // text to display in a footer, please do not change if you don't have to
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
// this is an extra layer displayed during domain search. It is helpfull when someone is
// searching for all domains at once.
// if you are not confident with layers at all
// just disable it - set the first value below to false.
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 to 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 to 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 .net 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
// .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 ' ';
echo '</td>
<td nowrap align="center" class="available"><b>'.$what.'</b></td><td colspan=3> </td></tr>';
}
// function to display an unavailable domain with additional links
function dispun($what,$where)
{
echo '<tr>
<td colspan="2"> </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.'">
<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 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>
<a class="footerpowered" href="http://www.mrscripts.co.uk" target="_blank">'.powered_by.'</a>
</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>'.page_title_meta.'</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>';
pagefooter();
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();
pagefooter();
exit;
}
if(strlen(ddomain) > 63)
{
pageheader();
disperror(error_too_long);
main();
pagefooter();
exit;
}
if(ereg("^-|-$",ddomain))
{
pageheader();
disperror(error_hyphen);
main();
pagefooter();
exit;
}
if(!ereg("([a-z]|[a-z]|[0-9]|-){".strlen(ddomain)."}",ddomain))
{
pageheader();
disperror(error_characters);
main();
pagefooter();
exit;
}
pageheader();
startborder();
echo '
<table width="100%" align="center" cellspacing="0" cellpadding="1">
<tr>
<td nowrap align="center" class="separator"><b> </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> </b></td>
<td nowrap align="center" class="separator"><b> </b></td>
</tr>';
if ( (type == "all" or type == "com") and com_include )
{
$com_array = array(ddomain.".com",ddomain.".net");
$com_count = count($com_array);
$i=0;
for ($i=0;$i<$com_count;$i++)
{
$domname = $com_array[$i];
$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"> </td></tr>';
}
if ( (type == "all" or type == "org") and org_include )
{
$org_array = array(ddomain.".org");
$org_count = count($org_array);
$i=0;
for ($i=0;$i<$org_count;$i++)
{
$domname = $org_array[$i];
$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"> </td></tr>';
}
if ( (type == "all" or type == "info") and info_include )
{
$info_array = array(ddomain.".info");
$info_count = count($info_array);
$i=0;
for ($i=0;$i<$info_count;$i++)
{
$domname = $info_array[$i];
$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"> </td></tr>';
}
if ( (type == "all" or type == "biz") and biz_include )
{
$biz_array = array(ddomain.".biz");
$biz_count = count($biz_array);
$i=0;
for ($i=0;$i<$biz_count;$i++)
{
$domname = $biz_array[$i];
$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"> </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();
pagefooter();
}
else
{
pageheader();
main();
pagefooter();
}
?>
[/php]