rudolfpietersma Posted April 10, 2010 Share Posted April 10, 2010 (edited) Hi there, Can anybody tell me how to get this kind of domain checker used on this site? (At the top right). http://www.anolimit.com/?domain=rudolf.nl Rudolf. Edited April 10, 2010 by rudolfpietersma 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted April 10, 2010 Share Posted April 10, 2010 If you want to find the status of a domain name outside your WHMCS envirnoment, you could use the domainwhois API-function. For more information, see: http://wiki.whmcs.com/API:Domain_WHOIS 0 Quote Link to comment Share on other sites More sharing options...
rudolfpietersma Posted April 12, 2010 Author Share Posted April 12, 2010 Hi m00, Can you give me some example html because I don't understand how to use it? Rudolf. 0 Quote Link to comment Share on other sites More sharing options...
abhinav Posted April 13, 2010 Share Posted April 13, 2010 <form action="http://www.yourdomain.com/clients/domainchecker.php" method="post"> <input type="hidden" name="token" value="6c1e24a9c785809e2cba609350fda891c9c982ed" /> <input type="hidden" name="direct" value="true"> Domain: <input type="text" name="domain" size="20"> <select name="ext"> <option>.com</option> <option>.net</option> <option>.in</option> </select> <input type="submit" value="Go"> </form> 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted April 13, 2010 Share Posted April 13, 2010 If you want to fully integrate it in your own website, you could try: <?php $extenties = array("nl","com","co.uk","sc"); // Allowed extensions if(isset($_GET['domein']) AND preg_match('/[^.]+\.[^.]+$/', $_GET['domein'])) { $domeinnaam = urlencode($_GET['domein']); $domeindeel = explode(".", $domeinnaam, 2); if(in_array($domeindeel[1], $extenties)) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "*** URL TO YOUR WHMCS ENVIRONMENT ***/includes/api.php"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 100); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, array("username" => "*** WHMCS ADMIN USER ***", "password" => md5("*** WHMCS ADMIN PASS ***"), "action" => "domainwhois", "domain" => $domeinnaam)); $data = curl_exec($ch); curl_close($ch); $data = explode(";",$data); foreach ($data AS $temp) { $temp = explode("=",$temp); $results[$temp[0]] = @$temp[1]; } if($results['status'] == "available") $result = "<b>".$domeinnaam."</b> is free for <a href=\"whmcs/cart.php?a=add&domain=register&sld=".$domeindeel[0]."&tld=.".$domeindeel[1]."\">registration</a>."; else $result = "<b>".$domeinnaam."</b> is already taken. You can <a href=\"whmcs/cart.php?a=add&domain=transfer&sld=".$domeindeel[0]."&tld=.".$domeindeel[1]."\">transfer</a> it if you're the owner ."; } else $result = "<b>".$domeinnaam."</b> is not available for registration/a transfer."; } echo "<form method=\"get\" action=\"".$_SERVER["SCRIPT_NAME"]."\">\n"; echo " <input type=\"text\" name=\"domein\" /> \n"; echo " <input type=\"submit\" value=\"Check\" /><br />\n"; echo " ".@$result."\n"; echo "</form>\n"; ?> Don't forget to change the WHMCS API URL, user and password. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.