Hi again.
The idea is to as you where a browser, get the results, find a string, css or something in the view source that can tell you when its free or not free and send back to whmcs the string that needs.
My registrar when a domain is not available has a class (
<b class="error">
) in its page named error (doesn't exist when a domain is free).If you want to use another registrar you have to change some of the vars in the script.
open includes/whoisservers.php and add at the first line :
.gr|http://www.yourdomain.gr/where_wcmc_is/domain- check.php?sdomain=|HTTPREQUEST-NO MATCH
This tells that wcmcs will use your php for gr checks.
upload to your whmcs folder (http://www.yourdomain.gr/where_wcmc_is/) the file domain- check.php that contains :
<?php
$arr=explode(".",$sdomain);
$domain=$arr[0];
$ext=".".$arr[1];
$webfile="http://www.ip.gr/el/main/whois.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$webfile);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"domain=$domain&ext=$ext");
$result = curl_exec($ch);
curl_close($ch);
if (strstr($result,"<b class=\"error\">")) { echo "Domain Taken"; }
else { echo "NO MATCH"; }
?>
The script posts to the registrar form your data and checks for a match and returns it to whmcs.The problem is that if the registrar changes the page layout the script will not work. But at the end we are the only country without an open whois server. Anything that works is welcome