} include 'lib/SmartDOMDocument.class.php'; $whois_server = 'http://www.whois.com'; //whois url which used to get domain info //$result = file_get_contents('http://www.whois.com/whois/'.$domain); /*$content_doc = new SmartDOMDocument(); $content_doc->loadHTML($result); try { $parag1 = $content_doc->getElementById("registryBlk"); $parag2 = $content_doc->getElementById("registrarBlk"); for($i=0;$i<$parag1->getElementsByTagName()->count();$i++) { $img = $parag1->getElementsByTagName()->item($i); $src = $whois_server.$img->getAttribute('src'); $img->setAttribute('src',$src); } $new = new SmartDOMDocument(); $new->appendChild($new->importNode($parag1, true)); $new->appendChild($new->importNode($parag2, true)); $result = $new->saveHTMLExact(); //_print($result); //cache whois cacheWhoisDomain($domain,$result); echo $result; } catch(Exception $e) { }*/ cacheWhoisDomain($domain, $result); echo $result; } }
<?php session_start(); //session start include 'functions.php'; if (isset($_SERVER['HTTP_REFERER'])) { $parse = parse_url($_SERVER['HTTP_REFERER']); if ($parse['host'] == $_SERVER['SERVER_NAME']) { //sure come from same domain? $domain = $_GET['domain']; echo cacheWhoisDomain($domain); } }