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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: emilt at tot-consult dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 17:01:28 2025 UTC