curl-and-php
Re: curl and ampersands
From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 7 Jan 2004 13:57:56 +0100 (CET)
Date: Wed, 7 Jan 2004 13:57:56 +0100 (CET)
On Wed, 7 Jan 2004, Jeff Philapy wrote:
> The code below works but it confuses the ampersands in my $body variable
> text with the ampersands in the CURLOPT_POSTFIELDS. I need to be able to use
> the ampersands in my text. How do I work around this?
The data you pass to curl to POST must be "URL-encoded" by you or your
program. That means you replace reserved characters with %XX codes where XX is
a two-digit hexadecimal code. & then becomes %26.
-- Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/ [[ Do not send mails to this email address. They won't reach me. ]] ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=clickReceived on 2004-01-07