|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-09-23 13:16 UTC] rasmus@php.net
[2011-09-23 13:21 UTC] rasmus@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: rasmus
[2011-09-23 13:21 UTC] rasmus@php.net
[2011-09-23 22:41 UTC] brad at hostland dot com
[2011-10-22 14:39 UTC] mat999 at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 00:00:01 2025 UTC |
Description: ------------ If you use a numeric array key to represent a numeric field name, cURL will ignore the field completely when submitting the POST. For example, suppose you have an HTML form containing a field named 'somefield' and another field named '100'. We want to simulate submitting this form using cURL: When the script below is executed, cURL will submit the form and pass the 'somefield' data, but will completely ignore the '100' data in the form post. $ch = curl_init('http://www.someurl.com'); curl_setopt($ch, CURLOPT_POST, 1); $fields['somefield'] = 'Some Data'; $fields['100'] = 'Some Other Data'; curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); $output = curl_exec($ch); Test script: --------------- $ch = curl_init('http://www.someurl.com'); curl_setopt($ch, CURLOPT_POST, 1); $fields['somefield'] = 'Some Data'; $fields['100'] = 'Some Other Data'; curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); $output = curl_exec($ch);