php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40426 POST problem with input image
Submitted: 2007-02-10 00:53 UTC Modified: 2007-02-10 00:55 UTC
From: develop at in-tech dot us Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.4.4 OS: Windows XP Pro, Windows 2000 Svr
Private report: No CVE-ID: None
 [2007-02-10 00:53 UTC] develop at in-tech dot us
Description:
------------
Using: I.E. 6, Firefox 2.0.0.1 and Opera 9, PHP 4.4.4, IIS 5.1 on XP PRO (development machine) and IIS 5 on Windows 2000 Server (production server).

When using an input type of 'image' to submit a form, the name value is not initialized by my switch() script. If I change this to a standard input type of 'submit', the variable is initialized and recognized just fine:


Reproduce code:
---------------
//DOES NOT work
<input type="image" src="/images/pic.jpg" name="somevalue" />

if(!empty($_POST['somevalue'])) {
  switch($_POST['hiddenfieldname']) {

     case 'somecase':

      include 'page1.php';
      break;
}
}
else {
     include 'page2.php';
}


//Works Fine
<input type="submit" name="somevalue" value="Submit" />

if(!empty($_POST['somevalue'])) {
  switch($_POST['hiddenfieldname']) {

     case 'somecase':

      include 'page1.php';
      break;
}
}
else {
     include 'page2.php';
}




Expected result:
----------------
Script should include() page1.php

Actual result:
--------------
Includes() page2.php

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-10 00:55 UTC] tony2001@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.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Apr 01 02:00:02 2026 UTC