cURL / Mailing Lists / curl-users / Single Mail

curl-users

multipart/formpost result?

From: <nvqtq_at_naver.com>
Date: Tue, 25 Jun 2002 14:21:54 +0900 (KST)

Hello.
Why is the result of this program like the this?
What there is the fault.
The postingfieldname does not know why we are changed in this way.
Inform the invalid program please.

-------------------------------------------------------------------------------
------------------------------ php source --------------------------------

<?
$post['mode'] = 'result';
$post['val1'] = 'value1';
$post['val2'] = 'value2';
$post['val3'] = 'value3';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://test.com/test.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 1 );
curl_setopt($ch, CURLOPT_VERBOSE, 1 );
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)");
curl_setopt($ch, CURLOPT_POSTFIELDS, $post );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
echo "$result";
curl_close($ch);
?>

-------------------------------------------------------------------------------
------------------ network snipping result -----------------------------


POST /test.php HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Host: test.com
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 417
Expect: 100-continue
Content-Type: multipart/form-data; boundary=curlgyo1xC0h80m1EP5OD3RQcSQqRqk

--curlgyo1xC0h80m1EP5OD3RQcSQqRqk
Content-Disposition: form-data; name="mode1" //<!---The postingfieldname does not know why we are changed in this way.-->

result
--curlgyo1xC0h80m1EP5OD3RQcSQqRqk
Content-Disposition: form-data; name="val11" //<!---The postingfieldname does not know why we are changed in this way.-->

value1
--curlgyo1xC0h80m1EP5OD3RQcSQqRqk
Content-Disposition: form-data; name="val21" //<!---The postingfieldname does not know why we are changed in this way.-->

value2
--curlgyo1xC0h80m1EP5OD3RQcSQqRqk
Content-Disposition: form-data; name="val31" //<!---The postingfieldname does not know why we are changed in this way.-->

value3
--curlgyo1xC0h80m1EP5OD3RQcSQqRqk--

-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
Received on 2002-06-25