curl-and-php
Re: Problem with new line
Date: Sun, 9 Mar 2003 20:18:06 +0100 (CET)
On Sat, 8 Mar 2003, Per Sandberg wrote:
> When i use the -F option with curl it doesnt seem to send anything after a
> new line in a <textarea>.
What curl version on what operating system?
> The site i am posting my data to only displays the first line from the
> <textarea>
>
> this is the whole string i use exec(); on:
>
> $cmd = '/usr/local/bin/curl -e -F "txtName='.$POST["name"].'" -F
> "txtPhone='.$POST["phone"].'" -F "txtEmail='.$POST["email"].'" -F
> "sltNew_Zon='.$region[7].'" -F "txtCity='.$POST["subrgn"].'" -F
> "txtMode='.$type[7].'" -F "sltNew_Cate='.$category[7].'" -F
> "txtTitle='.$POST["header"].'" -F "txtDesc='.$POST["text"].'" -F
> "txtUrl='.$POST["infolnk"].'" -F "txtNameUrl='.$POST["infotitle"].'" -F
> "userfile='.$data['userfile'].'" -F "txtPassword='.$POST['password'].'" -F
> "submit=Lägg in annons" -e http://www.fyndtorget.se/annons_new.php
> http://www.fyndtorget.se/check.php';
I'd suggest using the --trace option to debug this properly. You can then get
a full dump of the entire request and see what was sent and what wasn't.
I can't recall or find any code in curl that cares about newlines in -F data,
but I suspect that your shell perhaps is playing tricks on you...
> Now everything works fine besides the "txtDesc" which only displays the
> first line on the <textarea>. I have not urlencoded any data as I've
> learned that you shouldnt do that when using "-F".
Correct, -F texts should be sent "binary".
PS, when asking questions about the curl tool, consider using the curl-users
mailing list which is crowded with curl-tool users...
-- Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs. ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.comReceived on 2003-03-09