1981191919 0 Newbie Poster

I have been working for hours to get this works the problem is that when I first execute this code everything is ok but second time nothing displays. Then I realized that if I wait 20-25 seconds gets executed again I am using this way

whois("google","web.tr")

I dont get any problem the other extensions(com,net) so on

 function whois($domainName, $ext)
 {
 $servers = array(
    "biz" => "whois.neulevel.biz",
    "com" => "whois.internic.net",    
    "com.tr" => "whois.nic.tr",
    "gen.tr" => "whois.nic.tr",
    "web.tr" => "whois.nic.tr",
    "k12.tr" => "whois.nic.tr",
    "org.tr" => "whois.nic.tr"
  );
$serverName = trim($servers[$ext]);
$tamAd=$domainName.".".$ext;
$whois = array();

$output = "";
if (function_exists('curl_version')) {
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $serverName);
    curl_setopt($curl, CURLOPT_PORT, 43);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_TIMEOUT, 5);
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $tamAd. "\r\n");
    $result = curl_exec($curl);
    curl_close($curl);
    print_r($result);
   } 
 }
       whois("google","web.tr");

What should I do .I dont understand why "web.tr" doesnt work properly.The other works great Any idea plase

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.