rendered paste body<?php require("../dbconnect.php"); require("../includes/functions.php"); $query = 'SELECT extension FROM `tbldomainpricing`'; $result = mysql_query($query) or die(mysql_error()); while ($data = mysql_fetch_array($result)) { $tld_exts[] = $data[extension]; } function checkDomain($domain, $server, $findText) { // Open a socket connection to the whois server $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 (stripos($response, $findText)) { return true; } else { return false; } } function showDomainResult($domain, $server, $findText) { if (checkDomain($domain, $server, $findText)) { echo "<tr style='color:red'><td>$domain</td><td> $server<br /> $findText<br /></td></tr>"; } else { echo "<tr style='color:green'><td>$domain</td><td> $server<br /> $findText<br /></td></tr>"; } } // Check domains only if the base name is big enough if (strlen($_REQUEST['domainbase']) > 2) {?> <div id="caption">RESULT</div> <div id="result"> <table width="100%"><?php $domainbase = (isset($_GET['domainname'])) ? $_GET['domainname'] : ''; $d_all = (isset($_GET['all'])) ? 'all' : ''; $whoisservers = file('../includes/whoisservers.php'); /** * Initialize the map * Bobby Easland */ $map = array(); foreach ($whoisservers as $bar) { $tldwhoislist = explode('|', $bar); /** * Check to make sure it exists in the DB data * If not continue */ if (!in_array($tldwhoislist[0], $tld_exts)) { continue; } $map[] = $tldwhoislist; } print_r($map); for ($i = 0, $n = count($map); $i < $n; $i++) { //$domain = $_REQUEST['domainbase'] . $map[$i][0]; //$server = $map[$i][1]; //$findText = $map[$i][2]; // echo $domain.'<br />'; // echo $server.'<br />'; // echo $findText.'<br />'; // if (($tld != '') || ($d_all != '') ){ showDomainResult($_REQUEST['domainbase'] . $map[$i][0], $map[$i][1], $map[$i][2]); // } }?> </table> </div><?php }?>