Domeincheck (WHOIS)
Auteur: WumTol - 12 maart 2006 - 12:36 - Gekeurd door: nemesiskoen - Hits: 21937 - Aantal punten: 3.33 (3 stemmen)
Zeer handige domeincheck met de mogelijkheid extensies toe te voegen in de $whois-array:
$whois['ext'] = array(server, poort, domein, vrijbericht);
|
Code: |
<?php
ob_start();
?>
<html>
<head>
<title>wTol. ~ Whois</title>
<style>
body, td, input {
font-family: verdana;
font-size: 11px;
}
form {
margin: 0px;
}
a {
color: black;
text-decoration: none;
}
</style>
</head>
<body>
<?php
$whois = array();
$whois['nl'] = array("whois.domain-registry.nl", 43, "{domein}.nl", "is free");
$whois['be'] = array("whois.dns.be", 43, "{domein}", "FREE");
$whois['com'] = array("whois.nsiregistry.net", 43, "{domein}.com", "No match for");
$whois['net'] = array("whois.nsiregistry.net", 43, "{domein}.net", "No match for");
$whois['org'] = array("whois.publicinterestregistry.net", 43, "{domein}.org", "NOT FOUND");
$whois['info'] = array("whois.afilias.info", 43, "{domein}.info", "NOT FOUND");
$whois['biz'] = array("whois.biz", 43, "{domein}.biz", "Not found:");
$whois['nu'] = array("whois.nic.nu", 43, "{domein}.nu", "NO MATCH");
function whois($whois)
{
list ($server, $poort, $domein, $vrij) = $whois;
$domein = str_replace("{domein}", $_GET['domein'], $domein);
$fp = fsockopen($server, $poort);
if($fp)
{
fputs($fp, $domein."\r\n");
while(!feof($fp))
{
$data .= fread($fp, 1000);
}
fclose($fp);
}
else
{
$data = "error";
}
return $data;
}
if ($_REQUEST['submit'])
{
header("location:?domein=".$_POST['domein']);
}
elseif (!empty($_GET['domein']))
{
if (!empty($_GET['ext']))
{
echo "<pre>".whois($whois[$_GET['ext']])."</pre>".
"<br>".
"» <a href=\"?domein=".$_GET['domein']."\">Terug</a>";
}
else
{
echo "<table>".
"<tr>".
"<td><u>Domeincheck:</u></td>".
"<td> </td>".
"</tr>";
foreach ($whois as $ext => $value)
{
list ($server, $poort, $domein, $vrij) = $value;
$data = whois($value);
if (!ereg($vrij, $data))
{
$status = "<a href=\"?domein=".$_GET['domein']."&ext=".$ext."\"><font color=\"red\">bezet</font></a>";
}
elseif ($data == "error")
{
$status = "<font color=\"red\">error</font>";
}
else
{
$status = "<font color=\"darkgreen\">vrij</font>";
}
echo "<tr>".
"<td>".$_GET['domein'].".".$ext."</td>".
"<td align=\"right\">".$status."</td>".
"</tr>";
}
echo "</table>".
"<br>".
"» <a href=\"whois.php\">Terug</a>";
}
}
else
{
?>
<form method="post">
<table>
<tr>
<td>Domeinnaam zonder extensie:</td>
<td><input type="text" name="domein"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="submit" value="Controleer!"></td>
</tr>
</table>
</form>
<?php
}
?>
</body>
</html>
<?php ?> <html> <head> <title>wTol. ~ Whois</title> <style> body, td, input { font-family: verdana; font-size: 11px; } form { margin: 0px; } a { color: black; text-decoration: none; } </style> </head> <body> <?php $whois['nl'] = array("whois.domain-registry.nl", 43, "{domein}.nl", "is free"); $whois['be'] = array("whois.dns.be", 43, "{domein}", "FREE"); $whois['com'] = array("whois.nsiregistry.net", 43, "{domein}.com", "No match for"); $whois['net'] = array("whois.nsiregistry.net", 43, "{domein}.net", "No match for"); $whois['org'] = array("whois.publicinterestregistry.net", 43, "{domein}.org", "NOT FOUND"); $whois['info'] = array("whois.afilias.info", 43, "{domein}.info", "NOT FOUND"); $whois['biz'] = array("whois.biz", 43, "{domein}.biz", "Not found:"); $whois['nu'] = array("whois.nic.nu", 43, "{domein}.nu", "NO MATCH"); function whois($whois) { list ($server, $poort, $domein, $vrij) = $whois; $domein = str_replace("{domein}", $_GET['domein'], $domein); if($fp) { fputs($fp, $domein."\r\n"); { $data .= fread($fp, 1000); } } else { $data = "error"; } return $data; } if ($_REQUEST['submit']) { header("location:?domein=".$_POST['domein']); } elseif (!empty($_GET['domein'])) { if (!empty($_GET['ext'])) { echo "<pre>".whois ($whois[$_GET['ext']])."</pre>". "<br>". "» <a href=\"?domein=".$_GET['domein']."\">Terug</a>"; } else { "<tr>". "<td><u>Domeincheck:</u></td>". "<td> </td>". "</tr>"; foreach ($whois as $ext => $value) { list ($server, $poort, $domein, $vrij) = $value; $data = whois($value); { $status = "<a href=\"?domein=".$_GET['domein']."&ext=".$ext."\"><font color=\"red\">bezet</font></a>"; } elseif ($data == "error") { $status = "<font color=\"red\">error</font>"; } else { $status = "<font color=\"darkgreen\">vrij</font>"; } "<td>".$_GET['domein'].".".$ext."</td>". "<td align=\"right\">".$status."</td>". "</tr>"; } "<br>". "» <a href=\"whois.php\">Terug</a>"; } } else { ?> <form method="post"> <table> <tr> <td>Domeinnaam zonder extensie:</td> <td><input type="text" name="domein"></td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" value="Controleer!"></td> </tr> </table> </form> <?php } ?> </body> </html>
Download code (.txt)
|
|
Stemmen |
Niet ingelogd. |
|