|
-
Oct 12th, 2012, 07:17 AM
#1
Thread Starter
New Member
CURL post TO multipart/form-data
Hello
iam using curl to post data type of it
Content-Type: multipart/form-data; boundary=---------------------------25550903729072
-----------------------------25550903729072
Content-Disposition: form-data; name="textarea_172341"
hello
-----------------------------25550903729072
Content-Disposition: form-data; name="ner"
1
-----------------------------------------------
i can post without any issues just the problem that there is missing special characters <> - and i cant encode it because it will be posted as encoded and i want it be shown as <> on the textarea not as encoded
ty
-
Oct 13th, 2012, 03:05 PM
#2
Re: CURL post TO multipart/form-data
Hi. Welcome to the forums 
See if this decoding function helps on decoding it: http://php.net/manual/en/function.ht...ity-decode.php
If not, please post the code and include the samples of the output you are getting and you were expecting.
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Oct 16th, 2012, 03:10 PM
#3
Thread Starter
New Member
Re: CURL post TO multipart/form-data
Hello
ty for replying
my problem still - i can encode the data before posting it - but the problem that it will be shown as encoded - and i cant decode it because i dont own the other side - its posting to other place
Here is code :
$link = "www.site.com"
$datatopost = array (
'textarea_21234' => "firstdata" <iamherehihowru>",
'name' => "samy",
);
$c=curl_init();
curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; rv:2.2) Gecko/20110201");
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($c, CURLOPT_TIMEOUT,15);
curl_setopt ($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_POSTFIELDS, $datatopost);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($c, CURLOPT_CONNECTTIMEOUT ,60);
curl_setopt($c, CURLOPT_TIMEOUT, 60);
curl_setopt($c, CURLOPT_HEADER, 0);
$crdata=curl_exec($c);
curl_close($c);
everything is good and able to post but when i check the textarea which my data should go to it i see it show this only
"firstdata"
and <iamherehihowru> total disapeared due to <> - problem that if i used urlencode as example it will be like this %3Ciamherehihowru%3E and this i dont want - i want it be shown as <> in the other side inside Textarea
Here also Request Header
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Content-Type: multipart/form-data; boundary=---------------------------3303192328350
Content-Length: 2836
--------------------
Response Header
HTTP/1.1 200 OK
Date: Tue, 16 Oct 2012 20:07:05 GMT
Vary: Accept-Encoding
Content-Type: text/html; charset=utf-8
Content-Encoding: gzip
Cache-Control: private
Age: 0
Transfer-Encoding: chunked
Connection: keep-alive
hope there is any solution - ty
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|