<?
if ($_POST['type']!="") define('TYPE', $_POST['type']); else define('TYPE', '');
if ($_POST['domain']!="") define('DOMAIN', $_POST['domain']); else define('DOMAIN', '');
// .com domains
define('COM_SERVER', "rs.internic.net"); // server to lookup for domain name
define('COM_NOMATCH', "No match"); // string returned by server if the domain is not found
define('COM_INCLUDE', true); // include this domain in lookup
function search_form($error){
echo $error;
?>
<center><form name="whois" method="post" action="">
<input name="domain" style="text-align:center" type="text" id="domain" value="Choose your domain!" onclick="clearwhois();" onblur="returnwhois()" />
<input name="Search" type="submit" id="Search" value="Go!">
</form></center>
<?
}
if($_REQUEST['Search']){
if($error){
search_form($error);
}
else{
$ns = fsockopen('rs.internic.net',43);
fputs($ns, $_POST['domain']."\r\n");
$result = '';
$suffix = strstr($_POST['domain'], '.');
if ($suffix == '.co.uk') $suffixprice = '3';
if ($suffix == '.com') $suffixprice = '5';
if ($suffix == '.net') $suffixprice = '8';
while(!feof($ns)) $result .= fgets($ns,128);
fclose($ns);
if (eregi('No match',$result)) {
echo '<center><form name="whois" method="post" action="">
<input name="domain" style="text-align:center" type="text" id="domain" value="Choose your domain!" onclick="clearwhois();" onblur="returnwhois()" />
<input name="Search" type="submit" id="Search" value="Go!">
</form>
<table border="0" cellpadding="0" cellspacing="3"><tr><th align="center" valign="middle" scope="col"><img src="../../images/other/tick.png"></tr><th align="center" valign="middle" scope="col">Domain Name '.$_POST['domain'].' is free.</tr></table><br /></form>
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="submit" value="Add to basket!">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="example@email.com">
<input type="hidden" name="item_name" value="'.$_POST['domain'].'">
<input type="hidden" name="amount" value="'.$suffixprice.'">
<input type="hidden" name="item_number" value="">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form>
</center>
';
}
else {
echo '<center><form name="whois" method="post" action="">
<input name="domain" style="text-align:center" type="text" id="domain" value="Choose your domain!" onclick="clearwhois();" onblur="returnwhois()" />
<input name="Search" type="submit" id="Search" value="Go!">
</form>
<table border="0" cellpadding="0" cellspacing="3"><tr><th align="center" valign="middle" scope="col"><img src="../../images/other/cross.png"></tr><th align="center" valign="middle" scope="col">Domain Name '.$_POST['domain'].' is not available.</tr></table><br /></form></center>';
}
}
}
else{
search_form($error);
}
?>