Re: problems with http post
| From: | Comex | Date: | Wed, 21 May 2003 21:20:19 +0000 |
| Subject: | Re: problems with http post | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148453@lists.php.net to get a copy of this message | ||
<20030521145734.70409.qmail@pb1.pair.com>
Ulrik Nielsen:
> Hi NG,
>
> I have a problem, that I can not understand:
>
> I'm trying to do a post via php's socket functions:
>
> I have two methods A and B. A works but B does not...
>
> A)
> fputs($sock, "POST " .$path." HTTP/1.0\r\n");
> fputs($sock, "Host: ".$host."\r\n");
> fputs($sock, "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
> rv:1.3.1) Gecko/20030425\r\n");
> fputs($sock, "Content-type: application/x-www-form-urlencoded\r\n");
> fputs($sock, "Content-length: ".strlen($data)."\r\n");
> fputs($sock, "\r\n");
> fputs($sock, $data."\r\n");
> fputs($sock, "\r\n");
> fputs($sock, "\r\n");
>
> B)
> $toPost ="POST: ".$path." HTTP/1.0\r\n";
^
Did you want the :?
> $toPost.="Host: ".$host."\r\n";
> $toPost.="User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
> rv:1.3.1) Gecko/20030425\r\n";
> $toPost.="Content-type: application/x-www-form-urlencoded\r\n";
> $toPost.="Content-length: ".strlen($data)."\r\n";
> $toPost.="\r\n";
> $toPost.=$data."\r\n";
> $toPost.="\r\n";
> $toPost.="\r\n";
> fputs($sock,$toPost);
>
>
> If I dump the $_REQUEST variable on the remote host, I only get the
> posted values If I'm using method A...
>
> Does any of you have an Idear why ?
--
1.41421356237309504880168872420969807856967187537694
It's true that it's not true, not taking into consideration the fact
that could not be not true, or perhaps the opposite, or perhaps not.
The search is more profitable than the find.
Never, ever back down.
The e-mail given is a spam trap.
..==// Why not? \\==..