g3x0

Domain Checker

Jan 8th, 2012
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.96 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4.     <title>Domain Check</title>
  5.     <style>
  6.     * { margin:0 ; padding:0 }
  7.     body { font-family:Arial, Tahoma, Verdana ; font-size:15px ; background-color:#CCC }
  8.     a { color:#888 ; text-decoration:none }
  9.     a:hover { color:#000 }
  10.     #alb { -webkit-border-top-left-radius: 15px;-webkit-border-top-right-radius: 15px;-moz-border-radius-topleft: 15px;-moz-border-radius-topright: 15px;border-top-left-radius: 15px;border-top-right-radius: 15px; }
  11.     </style>
  12. </head>
  13. <body>
  14. <center>
  15. <h1 style="margin-top:40px;font-family:Georgia, Times New Roman;font-style:italic;font-weight:normal;color:#000;text-shadow: 0 -1px 0 #DDD">Domain Checker</h1>
  16. <div id="alb" style="background-color:#FFF;width:280px;min-width:280px;margin-top:40px;padding:20px 10px;border-bottom:3px solid #DDD" align="center">
  17.     <div>
  18.         <form action="" method="GET">
  19.             <label>Domain name (e.g. domain.com)</label><br /><br />
  20.             <input type="text" size="30" name="domain" value="<?php echo @$_GET['domain'] ?>" autofocus />
  21.             <input type="submit" value="Check" />
  22.         </form><br />
  23.     </div>
  24.     <div>
  25.     <?php
  26.         if (isset($_GET['domain']) && $_GET['domain'] != '') {
  27.             $headers = @get_headers('http://'.$_GET['domain']);
  28.             $file = @file_get_contents('http://who.is/whois/'.$_GET['domain'].'/');
  29.             $html = explode("\n", $file);
  30.             if (strlen($headers[0]) > 0) {
  31.                 echo 'Domain <span style="color:#C00;font-weight:bold">registered</span>.';
  32.             } else {
  33.                 echo 'Domain <span style="color:#0C0;font-weight:bold">not registered</span>.';
  34.                 $file = @file_get_contents('http://who.is/whois/'.$_GET['domain'].'/');
  35.                 if (!preg_match('/appears to be available/', $file)) {
  36.                     echo '<br />Although who.is says it is.<br />Just check for any HTTP headers. :/';
  37.                 }
  38.                 unset($file);
  39.                 unset($html);
  40.             }
  41.         }
  42.     ?>
  43.     </div>
  44. </div>
  45. <div>
  46. <br />
  47. <p style="font-size:9pt;color:#888">by <a href="http://rstcenter.com/forum/members/gecko/">Gecko</a></p>
  48. </div>
  49. </center>
  50. </body>
  51. </html>
Advertisement
Add Comment
Please, Sign In to add comment