note 23332 deleted from ref.mail by spic

From: Date: Mon, 23 Sep 2002 14:27:04 +0000
Subject: note 23332 deleted from ref.mail by spic
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-37147@lists.php.net to get a copy of this message
Re: dariks@wp.pl To send a POST to another server with php, i would either: 1) open a socket to that remote server, and write the HTTP POST request... -create socket -write ("POST <uri> HTTP/1.0\n") -write ("...\n") -write("Content-type:application/x-www-form-urlencoded\n" -write("Content-length:".strlen($post_data."\n") -write("\n") =write($post_data."\n") 2) Use CURL lib, like ... $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$remote_host) curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch,CURLOPT_POSTFIELDS,$post_data) curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); $page = curl_exec ($ch); to see what all those CURLOPT mean go to http://curl.haxx.se/docs/ I hope this helps ! David

« previous php.notes (#37147) next »