public function sendPostData ($url, $postdata, $ip = null, $timeout = 10)
	{
		//set various curl options first

		// set url to post to
		curl_setopt($this->ch, CURLOPT_URL, $url);

		// return into a variable rather than displaying it
		curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);

		//bind to specific ip address if it is sent trough arguments
		if ($ip)
		{
			curl_setopt($this->ch, CURLOPT_INTERFACE, $ip);
		}

		//set curl function timeout to $timeout
		curl_setopt($this->ch, CURLOPT_TIMEOUT, $timeout);

		//set method to post
		curl_setopt($this->ch, CURLOPT_POST, true);

		$post_string = is_array($postdata) ? http_build_query($postdata) : $postdata;

		// set post string
		curl_setopt($this->ch, CURLOPT_POSTFIELDS, $post_string);

		//and finally send curl request
		$result = curl_exec($this->ch);

		if ($this->hasError())
		{
			return false;
		}

		return $result;
	}
public function sendPostData ($url, $postdata, $ip = null, $timeout = 10)
	{
		//set various curl options first

		// set url to post to
		curl_setopt($this->ch, CURLOPT_URL, $url);

		// return into a variable rather than displaying it
		curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);

		//bind to specific ip address if it is sent trough arguments
		if ($ip)
		{
			curl_setopt($this->ch, CURLOPT_INTERFACE, $ip);
		}

		//set curl function timeout to $timeout
		curl_setopt($this->ch, CURLOPT_TIMEOUT, $timeout);

		//set method to post
		curl_setopt($this->ch, CURLOPT_POST, true);

		$post_string = is_array($postdata) ? http_build_query($postdata) : $postdata;

		// set post string
		curl_setopt($this->ch, CURLOPT_POSTFIELDS, $post_string);

		//and finally send curl request
		$result = curl_exec($this->ch);

		if ($this->hasError())
		{
			return false;
		}

		return $result;
	}
public function sendPostData ( $ url , $ postdata , $ ip = null , $ timeout = 10 ) { //set various curl options first // set url to post to curl_setopt ( $ this -> ch , CURLOPT_URL , $ url ) ; // return into a variable rather than displaying it curl_setopt ( $ this -> ch , CURLOPT_RETURNTRANSFER , true ) ; //bind to specific ip address if it is sent trough arguments if ( $ ip ) { curl_setopt ( $ this -> ch , CURLOPT_INTERFACE , $ ip ) ; } //set curl function timeout to $timeout curl_setopt ( $ this -> ch , CURLOPT_TIMEOUT , $ timeout ) ; //set method to post curl_setopt ( $ this -> ch , CURLOPT_POST , true ) ; $ post_string = is_array ( $ postdata ) ? http_build_query ( $ postdata ) : $ postdata ; // set post string curl_setopt ( $ this -> ch , CURLOPT_POSTFIELDS , $ post_string ) ; //and finally send curl request $ result = curl_exec ( $ this -> ch ) ; if ( $ this -> hasError ( ) ) { return false ; } return $ result ; }
Send post request to target URL

@param string $url
@param mixed  $postdata (assoc array ie. $foo['post_var_name'] = $value or as string like var=val1&var2=val2)
@param string $ip       IP address to bind to [=null]
@param int    $timeout  Timeout in sec for complete curl operation [=10]

@return mixed string with data returned from url or boolean false if error occured
@access public
Send post request to target URL