From: [EMAIL PROTECTED]
Operating system: *
PHP version: 4CVS-2004-01-25 (stable)
PHP Bug Type: cURL related
Bug description: passing an array of form-fields to CURLOPT_POSTFIELDS does not work
Description:
------------
Using variable works, using plain array doesn't.
Reproduce code:
---------------
<?php
$ch = curl_init('http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi');
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_POSTFIELDS, array ('field1'=>'1','field2'=>'2'));
$result = curl_exec($ch);
var_dump($result);
curl_close($ch);
?>
Expected result:
----------------
string(463) "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">
<html lang="en-US">
<head>
<title>Echoing submitted form data</title>
</head>
<body>
<h1 style="font-size:1.2em">Echoing submitted form data</h1>
<table border="1" cellspacing="0">
<tr><th align="left" nowrap><tt>field1</tt></th><td
nowrap><tt>1</tt></td></tr>
<tr><th align="left" nowrap><tt>field2</tt></th><td
nowrap><tt>2</tt></td></tr>
</table>
<p>Processed 2004-01-26T00:01Z
</p></body></html>"
Actual result:
--------------
The field values appear as 'Z'
--
Edit bug report at http://bugs.php.net/?id=27040&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27040&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27040&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27040&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27040&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27040&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27040&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27040&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27040&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27040&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27040&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27040&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27040&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27040&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27040&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27040&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27040&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27040&r=float