All pastes #460937 Raw Edit

Unnamed

public text v1 · immutable
#460937 ·published 2007-04-27 12:03 UTC
rendered paste body
<html>
<head>
<title> Domain check script</title>
<body>
<b>The real script starts here</b>
<?php
function domaincheck($domain, $tld, $errormessage)
{
$f = "http://www.whois.net/whois_new.cgi?d=$domain&tld=$tld";
$handle = @fopen("$f", "r");
$domainname = $domain.".".$tld;
$contents = stream_get_contents($handle);
$domaincheck = strpos($contents, $errormessage);

if ($domaincheck == 0) {
echo "Domain is unavailable";
$tldlist = "comnetorgbizinfocom.pknet.pkorg.pkbiz.pk";
$tldselectpos = strpos($tldlist,$tld);
echo $tldselectpos;
} else {
?>
<table>
<tr>
<td>Domain Name</td><td>Status</td><td>Action</td>
</tr>
<tr>
<td><?php echo $domainname;?></td><td>Available</td><td>Register</td>
</tr>
</table>
<?php
}

}
$d = "sumair";
$t = "net";
$error = "No match found";
$answer =  domaincheck($d, $t, $error);
echo $answer;
?>