Call with:
script.php?domain=nisse&tld=dk
<? $response['dk']='No entries found for the selected source'; $response['com']='No match for "'.strtoupper($_REQUEST['domain'].".".$_REQUEST['tld']).'"'; $response['net']='No match for "'.strtoupper($_REQUEST['domain'].".".$_REQUEST['tld']).'"'; $response['org']='NOT FOUND'; exec("whois ".$_REQUEST['domain'].".".$_REQUEST[tld],$dat); if (preg_match("/".$response[$_REQUEST['tld']]."/i", implode($dat))) { echo "The domain is free for registration!"; } else { echo "The domain is <strong>not</strong> free for registration!"; } ?>