View Single Post
Join Date: Oct 2006
Posts: 200
Reputation: MaxMumford is an unknown quantity at this point 
Solved Threads: 2
MaxMumford's Avatar
MaxMumford MaxMumford is offline Offline
Posting Whiz in Training

whois script not working in IE

 
0
  #1
Jul 14th, 2008
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:
  1. if (eregi('No match',$result)) {
  2. echo 'Domain Name '.$_POST['domain'].' is free.';

dosnt show up... the script im using is below.

  1. <?
  2. if ($_POST['type']!="") define('TYPE', $_POST['type']); else define('TYPE', '');
  3. if ($_POST['domain']!="") define('DOMAIN', $_POST['domain']); else define('DOMAIN', '');
  4. // .com domains
  5. define('COM_SERVER', "rs.internic.net"); // server to lookup for domain name
  6. define('COM_NOMATCH', "No match"); // string returned by server if the domain is not found
  7. define('COM_INCLUDE', true); // include this domain in lookup
  8.  
  9. function search_form($error){
  10. echo $error;
  11. ?>
  12. <form name="whois" method="post" action="">
  13. <input name="domain" style="text-align:center" type="text" id="domain" value="Choose your domain!" />
  14. <input name="Search" type="submit" id="Search" value="Go!">
  15. </form>
  16. <?
  17. }
  18.  
  19. if($_REQUEST['Search']){
  20.  
  21. if($error){
  22. search_form($error);
  23. }
  24. else{
  25.  
  26. $ns = fsockopen('rs.internic.net',43);
  27. fputs($ns, $_POST['domain']."\r\n");
  28. $result = '';
  29.  
  30. while(!feof($ns)) $result .= fgets($ns,128);
  31. fclose($ns);
  32. if (eregi('No match',$result)) {
  33. echo 'Domain Name '.$_POST['domain'].' is free.';
  34. }
  35. else {
  36. echo 'Domain Name '.$_POST['domain'].' is not available.';
  37. }
  38. }
  39. }
  40. else{
  41. search_form($error);
  42. }
  43.  
  44. ?>

Any ideas why not?

Thanks for the help,

Max
Ill solve somebody's thread someday! xD
Reply With Quote