|
Written by administator
|
|
Thursday, 05 January 2012 15:33 |
|
showHeader(); if (!isset($_POST['submitBtn'])){ $this->showWhoisForm(); } else { $domainName = (isset($_POST['domain'])) ? $_POST['domain'] : ''; for ($i = 0; $i < sizeof($this->serverList); $i++) { $actTop = "top_".$this->serverList[$i]['top']; $this->serverList[$i]['check'] = isset($_POST[$actTop]) ? true : false; } // Check domains only if the base name is big enough if (strlen($domainName)>2){ echo ''; echo ''; for ($i = 0; $i < sizeof($this->serverList); $i++) { if ($this->serverList[$i]['check']){ $this->showDomainResult($domainName.".".$this->serverList[$i]['top'], $this->serverList[$i]['server'], $this->serverList[$i]['response']); } } echo '
'; } $this->showWhoisForm(); } $this->showFooter(); } function showDomainResult($domain,$server,$findText){ if ($this->tr == 0){ $this->tr = 1; $class = " class='tr2'"; } else { $this->tr = 0; $class = ""; } if ($this->checkDomain($domain,$server,$findText)){ echo "$domainAVAILABLE"; } else echo "$domainTAKEN"; } function checkDomain($domain,$server,$findText){ $con = fsockopen($server, 43); if (!$con) return false; // Send the requested doman name fputs($con, $domain."\r\n"); // Read and store the server response $response = ' :'; while(!feof($con)) { $response .= fgets($con,128); } // Close the connection fclose($con); // Check the response stream whether the domain is available if (strpos($response, $findText)){ return true; } else { return false; } } } ?>
|
|
Last Updated on Thursday, 05 January 2012 16:52 |