All pastes #419102 Raw Edit

Anonymous

public php v1 · immutable
·published 2007-04-01 01:30 UTC
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" />&nbsp;	  <select name="tld"><?php foreach ($allowed as $allowed_tld) {echo "<option value='{$allowed_tld}'>" . $allowed_tld . "</option>";} ?>	  </select>&nbsp;&nbsp;&nbsp;	  <input type="submit" name="check" value="Check" id="loading"/>&nbsp;&nbsp;&nbsp;		</form>