View Single Post
Join Date: Oct 2006
Posts: 198
Reputation: MaxMumford is an unknown quantity at this point 
Solved Threads: 1
MaxMumford's Avatar
MaxMumford MaxMumford is offline Offline
Junior Poster

Re: whois script not working in IE

 
0
  #3
Jul 14th, 2008
ah well i took out all of the irelavent information before posting it - for example at the moment if the whois dosnt find anything for a domain it will write a paypal add to basket button so i took all that out and in the process might have killed it a bit

here is an example of where the script is working:
http://www.economizerz.com/daniweb/w...iptexample.php

the full script im currently using is:

  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. <center><form name="whois" method="post" action="">
  13. <input name="domain" style="text-align:center" type="text" id="domain" value="Choose your domain!" onclick="clearwhois();" onblur="returnwhois()" />
  14. <input name="Search" type="submit" id="Search" value="Go!">
  15. </form></center>
  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. $suffix = strstr($_POST['domain'], '.');
  31. if ($suffix == '.co.uk') $suffixprice = '3';
  32. if ($suffix == '.com') $suffixprice = '5';
  33. if ($suffix == '.net') $suffixprice = '8';
  34.  
  35. while(!feof($ns)) $result .= fgets($ns,128);
  36. fclose($ns);
  37. if (eregi('No match',$result)) {
  38. echo '<center><form name="whois" method="post" action="">
  39. <input name="domain" style="text-align:center" type="text" id="domain" value="Choose your domain!" onclick="clearwhois();" onblur="returnwhois()" />
  40. <input name="Search" type="submit" id="Search" value="Go!">
  41. </form>
  42.  
  43. <table border="0" cellpadding="0" cellspacing="3"><tr><th align="center" valign="middle" scope="col"><img src="../../images/other/tick.png"></tr><th align="center" valign="middle" scope="col">Domain Name '.$_POST['domain'].' is free.</tr></table><br /></form>
  44. <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
  45. <input type="submit" value="Add to basket!">
  46. <input type="hidden" name="add" value="1">
  47. <input type="hidden" name="cmd" value="_cart">
  48. <input type="hidden" name="business" value="example@email.com">
  49. <input type="hidden" name="item_name" value="'.$_POST['domain'].'">
  50. <input type="hidden" name="amount" value="'.$suffixprice.'">
  51. <input type="hidden" name="item_number" value="">
  52. <input type="hidden" name="no_shipping" value="0">
  53. <input type="hidden" name="no_note" value="1">
  54. <input type="hidden" name="currency_code" value="GBP">
  55. <input type="hidden" name="lc" value="GB">
  56. <input type="hidden" name="bn" value="PP-ShopCartBF">
  57. </form>
  58. </center>
  59. ';
  60. }
  61. else {
  62. echo '<center><form name="whois" method="post" action="">
  63. <input name="domain" style="text-align:center" type="text" id="domain" value="Choose your domain!" onclick="clearwhois();" onblur="returnwhois()" />
  64. <input name="Search" type="submit" id="Search" value="Go!">
  65. </form>
  66.  
  67. <table border="0" cellpadding="0" cellspacing="3"><tr><th align="center" valign="middle" scope="col"><img src="../../images/other/cross.png"></tr><th align="center" valign="middle" scope="col">Domain Name '.$_POST['domain'].' is not available.</tr></table><br /></form></center>';
  68. }
  69. }
  70. }
  71. else{
  72. search_form($error);
  73. }
  74.  
  75. ?>

Max
Last edited by MaxMumford; Jul 14th, 2008 at 4:34 pm.
Ill solve somebody's thread someday! xD
Reply With Quote