php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25407 $HTTP_GET_VARS and $HTTP_POST_VARS
Submitted: 2003-09-06 22:58 UTC Modified: 2003-09-06 23:17 UTC
From: louison dot raymond at libertysurf dot fr Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.1 OS: windows xp pro
Private report: No CVE-ID:
 [2003-09-06 22:58 UTC] louison dot raymond at libertysurf dot fr
Description:
------------
If you submit a form with checkbox inputs which have same name but differents value, the $HTTP_GET_VARS and $HTTP_POST_VARS contain one value (not all the checkbox checked).
Nevertheless, the browser send values of all the checked inputs.

Configuration:
xp pro whith all updates
SERVER_SOFTWARE : Microsoft-IIS/5.1
Browser : Microsoft Internet Explorer Version 6.0.2600.0000.xpclnt_qfe.021108-2107

php.ini changes:
cgi.force_redirect = 0
fastcgi.impersonate = 1
file_uploads = On
upload_max_filesize = 2M

Reproduce code:
---------------
<FORM NAME="f" ACTION="http://localhost/test.php" METHOD="post" >
  <INPUT TYPE="Checkbox" NAME="groupes" VALUE="65">
  <INPUT TYPE="Checkbox" NAME="groupes" VALUE="55">
  <INPUT TYPE="Checkbox" NAME="groupes" VALUE="50">
  <INPUT TYPE="submit" >
</form>

test.php:
<?php
print_r($HTTP_POST_VARS);
?>

Expected result:
----------------
Array ( [groupes] => Array ( [0]=>65 [1]=>55 [2]=>50 ) )
For sample or
Array ( [groupes] => "65_55_50" )


Actual result:
--------------
result: Array ( [groupes] => 50 )
Yet i checked the three inputs and the browser send this query string :groupes=65&groupes=55&groupes=50

(This result is normal when it is known that $HTTP_POST_VARS is an associate array but it's not very logical)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-06 23:17 UTC] pollita@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

This is expected behavior.  Please reference the manual section on passing arrays via HTML forms.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 02:02:10 2014 UTC