Re: Wrong POSTFIELDS Posted
| From: | Matijn Woudt | Date: | Sat, 18 Feb 2012 12:43:54 +0000 |
| Subject: | Re: Wrong POSTFIELDS Posted | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-316724@lists.php.net to get a copy of this message | ||
On Sat, Feb 18, 2012 at 1:54 AM, Brian Smither <bhsmither@gmail.com> wrote:
> I have a script that accepts four POST variables. Three are used and five more are added for a
> total of eight keys and their urlencode() values all strung together in the proper format.
>
> Then cURL is initialized with the field string given to:
> curl_setopt($ch, CURLOPT_POST,8);
> curl_setopt($ch, CURLOPT_POSTFIELDS, $string);
>
> But that's not the string arriving at cURL's target URL! What's arriving at the
> target is exactly the POST array that this script received in the first place.
Isn't that just what urlencode is supposed to do?
If you want it to be urlencoded at the target, I think you need to
urlencode it twice.
There was something similiar a few months ago[1].
- Matijn
[1] http://lists-archives.com/php-general/372946-mcrypt_encrypt-help-needed.html