مرحبا يا شباب كيف الحال ...
طبعا اسف لكثرة اسألتي لكن اذا لم اسأل فلم اتعلم .. و بمساعدتكم الجميلة ساتعلم
عندي سكربت هو لفحص الدومين .
<?php
function checkDomain($domain,$server,$findText){
// Open a socket connection to the whois server
$con = fsockopen($server, 43) or die("1");
if (!$con) return false;
// Send the requested doman name
fputs($con, $domain."\r\n") or die("2");
// Read and store the server response
$response = ' :';
while(!feof($con)) {
$response .= fgets($con,128) or die("3");
}
// Close the connection
fclose($con);
// Check the response stream whether the domain is available
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>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>البحث عن دومين</title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
</head>
<body>
<div id="main">
<div id="caption">البحث عن نطاق</div>
<div id="icon"> </div>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="domain" id="domain">
الرجاء إدخال أسم موقعك المقترح لمعرفة إمكانية تسجيله
<table>
<tr><td><input class="text" name="domainname" type="text" size="36"/></td></tr>
<tr>
<td>
<input type="checkbox" name="all" checked />الجميع
<input type="checkbox" name="com"/>.com
<input type="checkbox" name="net"/>.net
<input type="checkbox" name="org"/>.org
<input type="checkbox" name="info"/>.info
</td></tr>
<tr><td align="center"><br/><input class="text" type="submit" name="submitBtn" value="بدء البحث"/></td></tr>
</table>
</form>
<?php
if (isset($_POST['submitBtn'])){
$domainbase = (isset($_POST['domainname'])) ? $_POST['domainname'] : '';
$d_all = (isset($_POST['all'])) ? 'all' : '';
$d_com = (isset($_POST['com'])) ? 'com' : '';
$d_net = (isset($_POST['net'])) ? 'net' : '';
$d_org = (isset($_POST['org'])) ? 'org' : '';
$d_info = (isset($_POST['info'])) ? 'info' : '';
// Check domains only if the base name is big enough
if (strlen($domainbase)>2){
?>
<table width="100%" border="1">
<?php
if (($d_com != '') || ($d_all != '') ) showDomainResult($domainbase.".com",'whois.crsnic.net','No match for');
if (($d_net != '') || ($d_all != '') ) showDomainResult($domainbase.".net",'whois.crsnic.net','No match for');
if (($d_org != '') || ($d_all != '') ) showDomainResult($domainbase.".org",'whois.publicinterestregistry.net','NOT FOUND');
if (($d_info != '') || ($d_all != '') ) showDomainResult($domainbase.".info",'whois.afilias.net','NOT FOUND');
?>
</table>
</div>
<?php
}
}
?>
</body>هذا السكربت الكامل لكن المشكلة فيه انه
في السيرفر الملي يقرأ بدون مشاكل لكن عند تحميله في السيرفر الغير محلي يعني سيرفر للموقع الخاص به عند فحص اي دومين يضهر لي هذا الخطء .
Warning: fsockopen() [function.fsockopen]: unable to connect to whois.crsnic.net:43 (Connection timed out) in /home/a2968951/public_html/iq/whois2/index.php on line 4
و شكرا جزيلا لكم .... مع تحياتي لكم ....

