private function call($params) 
    {
    	$param_data = "";   
    	foreach ($params as $param_name => $param_value) 
    	{
      		$param_data .= urlencode($param_name) .'='. urlencode($param_value) .'&'; 
    	}
    
    	if (!($fs = fsockopen(SWEETCAPTCHA_API_URL, SWEETCAPTCHA_API_PORT, $errno, $errstr, 10))) 
    	{
      		die ("Could not connect to server");
    	}
    
	    $req = "POST /api.php HTTP/1.0\r\n";
	    $req .= "Host: " . SWEETCAPTCHA_API_URL . "\r\n";
	    $req .= "Content-Type: application/x-www-form-urlencoded\r\n";
	    $req .= "Referer: " . $_SERVER['HTTP_HOST']. "\r\n";
	    $req .= "Content-Length: " . strlen($param_data) . "\r\n\r\n";
	    $req .= $param_data;    
  
	    $response = '';
	    fwrite($fs, $req);
	    
	    while (!feof($fs)) 
	    {
	      $response .= fgets($fs, 1160);
	    }
	    
	    fclose($fs);
	    
	    $response = explode("\r\n\r\n", $response, 2);
	    
	    return $response[1];  
	}
private function call($params) 
    {
    	$param_data = "";   
    	foreach ($params as $param_name => $param_value) 
    	{
      		$param_data .= urlencode($param_name) .'='. urlencode($param_value) .'&'; 
    	}
    
    	if (!($fs = fsockopen(SWEETCAPTCHA_API_URL, SWEETCAPTCHA_API_PORT, $errno, $errstr, 10))) 
    	{
      		die ("Could not connect to server");
    	}
    
	    $req = "POST /api.php HTTP/1.0\r\n";
	    $req .= "Host: " . SWEETCAPTCHA_API_URL . "\r\n";
	    $req .= "Content-Type: application/x-www-form-urlencoded\r\n";
	    $req .= "Referer: " . $_SERVER['HTTP_HOST']. "\r\n";
	    $req .= "Content-Length: " . strlen($param_data) . "\r\n\r\n";
	    $req .= $param_data;    
  
	    $response = '';
	    fwrite($fs, $req);
	    
	    while (!feof($fs)) 
	    {
	      $response .= fgets($fs, 1160);
	    }
	    
	    fclose($fs);
	    
	    $response = explode("\r\n\r\n", $response, 2);
	    
	    return $response[1];  
	}
private function call ( $ params ) { $ param_data = "" ; foreach ( $ params as $ param_name => $ param_value ) { $ param_data .= urlencode ( $ param_name ) . '=' . urlencode ( $ param_value ) . '&' ; } if ( ! ( $ fs = fsockopen ( SWEETCAPTCHA_API_URL , SWEETCAPTCHA_API_PORT , $ errno , $ errstr , 10 ) ) ) { die ( "Could not connect to server" ) ; } $ req = "POST /api.php HTTP/1.0\r\n" ; $ req .= "Host: " . SWEETCAPTCHA_API_URL . "\r\n" ; $ req .= "Content-Type: application/x-www-form-urlencoded\r\n" ; $ req .= "Referer: " . $ _SERVER [ 'HTTP_HOST' ] . "\r\n" ; $ req .= "Content-Length: " . strlen ( $ param_data ) . "\r\n\r\n" ; $ req .= $ param_data ; $ response = '' ; fwrite ( $ fs , $ req ) ; while ( ! feof ( $ fs ) ) { $ response .= fgets ( $ fs , 1160 ) ; } fclose ( $ fs ) ; $ response = explode ( "\r\n\r\n" , $ response , 2 ) ; return $ response [ 1 ] ; }
Call to Sweet Captcha service
@param  array $params
@return string
Call to Sweet Captcha service