hi guys,
I found a simple whois script and intregrated it completely into my site before testing it on IE (oooops!) and it only works on firefox and safari. On IE the result text that should be written as a result of the below section of the code:
if (eregi('No match',$result)) {
echo 'Domain Name '.$_POST['domain'].' is free.';
dosnt show up... the script im using is below.
<?
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;
?>
<form name="whois" method="post" action="">
<input name="domain" style="text-align:center" type="text" id="domain" value="Choose your domain!" />
<input name="Search" type="submit" id="Search" value="Go!">
</form>
<?
}
if($_REQUEST['Search']){
if($error){
search_form($error);
}
else{
$ns = fsockopen('rs.internic.net',43);
fputs($ns, $_POST['domain']."\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128);
fclose($ns);
if (eregi('No match',$result)) {
echo 'Domain Name '.$_POST['domain'].' is free.';
}
else {
echo 'Domain Name '.$_POST['domain'].' is not available.';
}
}
}
else{
search_form($error);
}
?>
Any ideas why not?
Thanks for the help,
Max