note 23332 added to ref.mail
| From: | frayday at yahoo dot com | Date: | Mon, 15 Jul 2002 19:15:50 +0000 |
| Subject: | note 23332 added to ref.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33102@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
--
http://www.php.net/manual/en/ref.mail.php
http://master.php.net/manage/user-notes.php?action=edit+23332
http://master.php.net/manage/user-notes.php?action=delete+23332
http://master.php.net/manage/user-notes.php?action=reject+23332