rendered paste body<?php
$allowed = array("com", "net", "org");
if (!in_array($tld, $allowed)) {
if (!isset($_REQUEST['check'])) {
$results = '';
} elseif (empty($_REQUEST['domain'])) {
$results = '<b>Please fill in all fields</b>';
} else {
$allowed = array("com", "net", "org");
$domain = $_REQUEST['domain'] . $_REQUEST['tld'];
$site = file_get_contents("http://isfree.schlundtech.de/cgi-bin/isfree.cgi?domain=$domain&lang=EN");
if (strpos($site, 'is still available') !== false) {
$results = "<b>$domain is Available</b> <a href='#'>Click here to order</a>";
} else {
$results = "<b>$domain is Not Available</b>";
}
}
}
?>
// FORM
<form action="<?php echo $PHP_SELF; ?>" method="post">
www.
<input type="text" name="domain" />
<select name="tld">
<?php
foreach ($allowed as $allowed_tld) {
echo "<option value='{$allowed_tld}'>" . $allowed_tld . "</option>";
}
?>
</select>
<input type="submit" name="check" value="Check" id="loading"/>
</form>