php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44647 Different values in $_POST and $REQUEST for name 'cp'
Submitted: 2008-04-05 18:22 UTC Modified: 2008-04-05 18:32 UTC
From: emilt at tot-consult dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: 5.2.5 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
16 - 3 = ?
Subscribe to this entry?

 
 [2008-04-05 18:22 UTC] emilt at tot-consult dot com
Description:
------------
I have a form with two radio buttons:
input type=radio name='cp' value='ASCII'
input type=radio name='cp' value='ANSI'

When the form is submitted with method POST, $_POST['cp'] is always 'ASCII' regardless of the selected button. $_REQUEST['cp'] is always correct, and so is $_GET['cp'] if the method is changed to GET.

This doesn't happen if the name of the control is different than 'cp'.

Using latest Apache 2.2.8


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-05 18:32 UTC] emilt at tot-consult dot com
Sorry, stupid of me!

I had 

if ($_POST['cp'] = 'ASCII')

instead of 

if ($_POST['cp'] == 'ASCII')
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 18:01:34 2024 UTC