<html>
<head>
<title>:::::Domain Sorgulama:::::</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-9">
<meta http-uquiv="Content-Type" content="text/html;charset=windows-1254">
</head>
<body>
<?php
if ( empty ( $HTTP_POST_VARS ) ) {
?>
<h1 aling="center">Domain Sorgulama</h1>
<form action="<? echo $PHP_SELF; ?>" method="post">
<table aling="center" border="0">
<tr>
<td>Domain adı</td>
<td>Uzantısı</td>
</tr>
<tr>
<td>
<input type="text" name="domain">
</td>
<td>
<select name="uzanti">
<option value=".com">.com</option>
<option value=".net">.net</option>
<option value=".org">.org</option>
<option value=".com.tr">.com.tr</option>
<option value=".net.tr">.net.tr</option>
<option value=".org.tr">.org.tr</option>
<option value=".edu.tr">.edu.tr</option>
<option value=".gov.tr">.gov.tr</option>
<option value=".mil.tr">.mil.tr</option>
<option value=".bbs.tr">.bbs.tr</option>
<option value=".k12.tr">.k12.tr</option>
<option value=".nom.tr">.nom.tr</option>
<option value=".gen.tr">.gen.tr</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="submit" value="SORGULA">
</div>
</td>
</tr>
</table>
</form>
<?php
} else {
if ( empty( $domain ) ) {
echo "Domain adını yazmadınız.Geri giderek bir domain adresi yazınız";
exit();
}
if ( ( $uzanti==".com" ) || ( $uzanti==".net" ) || ( $uzanti==".org" ) ) :
$server = "whois.internic.net";
else:
$server = "whois.metu.edu.tr";
endif;
$sorgu = @fsockopen ( $server, 43, &$no, &$mesaj, 20 );
if ( !$sorgu ) {
echo "Servera bağlanamadım.<br>\n";
echo "Hata numarası: <b>$no</b><br>\n";
echo "Hata mesajı: <b>$mesaj</b><br>\n";
exit();
}
fputs ( $sorgu, "$domain$uzanti\n" );
while ( ! feof ( $sorgu ) ) {
echo fgets ( $sorgu, 230 );
}
}
?>
</body>
</html>