|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-25 19:13 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 09:00:01 2025 UTC |
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'