السلام عليكــم ورحمـة الله وبركاتــه ،،
هدية متواضعة إلى أفضل أعضاء
البحث عن مدى توافر النطاق
من الممكطن زيادة النطاقات
اكتفيت هنا ب
com net org
الموضوع مفتوح لمن يريد
كود PHP:
PHP<?php
function checkDomain($domain, $server, $findText) {
$con = fsockopen ( $server, 43 );
if (! $con)
return false;
fputs ( $con, $domain . "\r\n" );
$response = ' :';
while ( ! feof ( $con ) ) {
$response .= fgets ( $con, 128 );
}
fclose ( $con );
if (strpos ( $response, $findText )) {
return true;
} else {
return false;
}
}
function showDomainResult($domain, $server, $findText) {
if (checkDomain ( $domain, $server, $findText )) {
echo "<tr><td>$domain</td><td>متاح</td></tr>";
} else
echo "<tr><td>$domain</td><td>محجوز </td><tr>
<td>
<a href=http://$domain target='_blank'>مشاهدة الموقع </a>
</td></tr><tr>
<td> <a href=http://whois.domaintools.com/$domain target='_blank'>معلومات عن الموقع</a> </td></tr>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html dir="rtl">
<head>
<meta http-equiv="Content-Language" content="ar-eg">
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1256">
<STYLE type=text/css>
a:hover {
background: #f5eeff;
color: #000000;
}
body {
background: #F8F9FF;
color: #95AFFF;
float: right;
}
p {
text-align: right;
float: right;
color: #95AFFF;
}
</style>
<title>البحث عن دومين</title>
</head>
<body>
<b>
<div align="center">
<form action="
<?php
echo $_SERVER ['PHP_SELF'];
?>
" method="post" name="domain">أدخل الدومين:
<table>
<tr>
<td align="right"><input name="domainname" type="text"
style="color: #000000; font-weight: bold" /></td>
</tr>
<tr>
<td align="right"><input type="checkbox" name="com" checked />.com</td>
</tr>
<tr>
<td align="right"><input type="checkbox" name="net" uncheck />.net</td>
</tr>
<tr>
<td align="right"><input type="checkbox" name="org" uncheck />.org</td>
</tr>
<tr>
<td align="center"><input type="submit" name="submitBtn"
value="Check domain" /></td>
</tr>
</table>
</form>
<?php
if (isset ( $_POST ['submitBtn'] )) {
$domainname = $_POST ['domainname'];
if (preg_match ( '/[ ]/', $domainname ))
echo 'يجب أن لا يحتوي اسم النطاق على مسافات';
else {
$domainbase = $domainname;
$d_com = (isset ( $_POST ['com'] )) ? 'com' : '';
$d_net = (isset ( $_POST ['net'] )) ? 'net' : '';
$d_org = (isset ( $_POST ['org'] )) ? 'org' : '';
if (strlen ( $domainbase ) > 2) {
echo '<table>';
if ($d_com != '')
showDomainResult ( $domainbase . ".com", 'whois.crsnic.net', 'No match for' );
elseif ($d_net != '')
showDomainResult ( $domainbase . ".net", 'whois.crsnic.net', 'No match for' );
elseif ($d_org != '')
showDomainResult ( $domainbase . ".org", 'whois.crsnic.net', 'No match for' );
if ($d_net != '')
showDomainResult ( $domainbase . ".net", 'whois.crsnic.net', 'No match for' );
if ($d_org != '')
showDomainResult ( $domainbase . ".org", 'whois.crsnic.net', 'No match for' );
echo '</table>';
} else
echo "يجب أن يكون اسم النطاق أكثر من حرفين ";
}
}
?>
</b>
</body>
</html>
للتجربة
http://www.ar-cms.com/domains.php
للمزيد من مواضيعي