I use the following code to check if a domain is available (API manual). How to make it work for multiple domains, not just one at a time - when I would use a textarea with domains on each row? <? $client = new SoapClient( null, array( "location" => "https://soap.subreg.cz/cmd.php", "uri" => " https://soap.subreg.cz/cmd.php" ) ); $params = array ( "data" => array ( "login" => "login", "password" => "seecretpassword", ) ); $response = $client->__call("Login",$params); $token = $response["data"]["ssid"]; unset($params); $params = array ( "data" => array ( "ssid" => $token, "domain" => 'google.com', ) ); $response = $client->__call("Check_Domain",$params); print_r($response); ?> PHP: Thank you for your answers.
foreach ($list_of_domains as $domain) { //check domain function here } (just for OP) - prostě si dej ty domény do arraye a foreachem to vyzkoušej postupně
I've already tried this, but the remote server always returns something like this: Array([status]=>error[error]=>Array([errormsg]=>UnsupportedTLD[errorcode]=>Array([major]=>501[minor]=>1002))) Array([status]=>ok[data]=>Array([name]=>google.com[avail]=>0)) PHP: Only the last domain is always being successfully checked, the previous are not.
Did you read that? [errormsg]=>UnsupportedTLD = unsupported domain shortcut (for example they support only .com, .net, .WHATEVER)
exactly! the whole solution lies in the error message itself (([errormsg]=>UnsupportedTLD) which means that only top level domains are supported not sub-domains, like you.yourdomainname.com would probably give an error but, youdomainname.com wouldn't
Well, the script prints error messages even if the TLDs are correct, for example: INPUT: google.com yahoo.com microsoft.com bing.com Code (markup): OUTPUT: Array ( [status] => error [error] => Array ( [errormsg] => Unsupported TLD [errorcode] => Array ( [major] => 501 [minor] => 1002 ) ) ) Array ( [status] => error [error] => Array ( [errormsg] => Unsupported TLD [errorcode] => Array ( [major] => 501 [minor] => 1002 ) ) ) Array ( [status] => error [error] => Array ( [errormsg] => Unsupported TLD [errorcode] => Array ( [major] => 501 [minor] => 1002 ) ) ) Array ( [status] => ok [data] => Array ( [name] => bing.com [avail] => 0 ) ) Code (markup): The last domain (bing.com) was checked, but previous domains were not. Why?
Now I know why it did not work - for some reason there was another char after ".com" except the last domain. trim($val) PHP: