note 30770 added to function.fsockopen
| From: | admin at php dot kz | Date: | Thu, 27 Mar 2003 23:19:41 +0000 |
| Subject: | note 30770 added to function.fsockopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45933@lists.php.net to get a copy of this message | ||
[quote]have seen in lot of places ppl asking on how to post data to another server using a php
script...so here is what is required to do that...
//create a string with all the posted data...
foreach ($HTTP_POST_VARS as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
}
.....
[/quote]
it is better to move '&' sign to the end of string
$req .= "$key=$value&";
--
http://www.php.net/manual/en/function.fsockopen.php
http://master.php.net/manage/user-notes.php?action=edit+30770
http://master.php.net/manage/user-notes.php?action=delete+30770
http://master.php.net/manage/user-notes.php?action=reject+30770