|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-08-30 11:00 UTC] tony2001@php.net
[2006-08-30 15:05 UTC] tjerk dot meesters at gmail dot com
[2006-08-30 15:17 UTC] tony2001@php.net
[2006-08-31 11:50 UTC] tjerk dot meesters at gmail dot com
[2006-09-01 12:58 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
Description: ------------ When file_get_contents() is used in combination with stream_context_create() not all wrapper options are taken into consideration. Tested PHP versions on Linux: 5.1.5 - not working 5.1.1 - working 5.0.4 - working This bug doesn't seems to appear on Windows platforms: 5.1.5 - working Reproduce code: --------------- <?php // this code will perform a POST request to a URL with this code: // print_r($_POST) echo file_get_contents("http://www.example.com/info.php",null,stream_context_create(array( 'http' => array( 'method' => 'POST', 'content' => 'cmd=_notify-validate', 'header' => 'Content-Type: application/x-www-form-urlencoded', ) ))); ?> Expected result: ---------------- Array ( [cmd] => _notify-validate ) The meta information: CONTENT_LENGTH: 20 REQUEST_METHOD: POST CONTENT_TYPE: application/x-www-form-urlencoded Actual result: -------------- Array ( ) The meta information: HTTP_USER_AGENT: PHP/5.1.5 <-- this didnt't appear anywhere else REQUEST_METHOD: GET CONTENT_TYPE: application/x-www-form-urlencoded