fscokpoen timed out error retriving details from who is server(working locally

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




all fallowing is my code for retriving the server deatis from remote server here  im facing fscokope time out error. fallowing is the error

but the same code is working locally in good

Warning: fsockopen() [function.fsockopen]: unable to connect to whois.internic.net:43 (Connection timed out) in /home/content/r/a/m/ramlinux/html/nannasales/domainreg/whois_27.php on line 15
Connection timed out (110)


fallowing is code




<?php
//session_start();
//adding the code
 include "config.php";
 $kquery="select keywords,user_id from alerts";
 $kvalues=mysql_query($kquery);


$domains=array();
while($kresult=mysql_fetch_array($kvalues))
      {
     $userid=$kresult['user_id'];
$fp = fsockopen("whois.internic.net",43, $errno, $errstr, 30);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
           $count=0;
 //   while($kresult=mysql_fetch_array($kvalues))
     // {
          $count++;
          //echo "count is".$count."<br>";
        $keyword=$kresult['keywords'];
      //echo "keyword malayappa".$keyword."<br>";
	 //echo "connected";
    $out = "$keyword\r\n";
    $out .= "Host: whois.internic.net\r\n";
    $out .= "Connection: Close\r\n\r\n";
	//echo "out is".$out."<br>";
    fwrite($fp, $out);
   // echo "file pointer written succesfully".$fp."<br>";
    while (!feof($fp)) {
       $str=fgets($fp, 128);
	  // echo "str is".print_r($str)."<br>";
         $upper=strtoupper($keyword);
         $lower=strtolower($keyword);
        // echo "upper is".$upper."<br>";
        // echo  "lower is".$lower."<br>";
        preg_match ("/($upper|$lower)/", $str, $matchesarray);
           if(preg_match ("/($upper|$lower)/", $str, $matchesarray))
		{
		    //echo "inside pregmatch<br>";
			array_push($domains, $str);

$query="insert into domaindetails(name,user_id)values('".$str."','".$userid."')";
             //echo "query is".$query."<br>";
            $result=mysql_query($query);
           

            

            //retriving particular domain details


            /*fputs($fp, $str."\r\n");
               while(!feof($fp)) {
			// echo "inside getting the value";
            $output .= fgets($fp,128);
            echo "output is".print_r($output)."<br>";
              $string="$output";
              $item="<<<";

            $index=strpos(strrev($string),strrev($item));

            $index=strlen($string)-strlen($item)-$index;

                 echo "indexis".$index."<br>";
              $domaindetails=substr($string,0,$index);



            echo "domain details r".print_r($domaindetails);
                            }*/


		   }
     
	 
    } //fp pointer while
     // } //while for keywords
	//echo "array is ".print_r($matchesarray);
    fclose($fp);
    } //while for keywords
}
 //preg_match ("/(NANNA|nanna)/", "NANNA.NET ", $matchesarray);
//echo"matcharray is".print_r($domains);
//satyam Host: whois.internic.net Connection: Close 

?>

   


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux