#42960 [Bgs->Opn]: PHP messes up image submit button data
| From: | jani@php.net | Date: | Mon, 15 Oct 2007 09:53:08 +0000 |
| Subject: | #42960 [Bgs->Opn]: PHP messes up image submit button data | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-118537@lists.php.net to get a copy of this message | ||
ID: 42960
Updated by: jani@php.net
Reported By: efbiaiinzinz at hotmail dot com
-Status: Bogus
+Status: Open
-Bug Type: Scripting Engine problem
+Bug Type: Feature/Change Request
Operating System: Windows XP/Linux
PHP Version: 5.2.4
New Comment:
Reopened. This is valid issue. Just not a bug but feature/change
request.
Previous Comments:
------------------------------------------------------------------------
[2007-10-14 12:13:56] bjori@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
See bug#42162
------------------------------------------------------------------------
[2007-10-14 10:56:53] efbiaiinzinz at hotmail dot com
Description:
------------
PHP messes up coordinates for <input type="image" .. fields when
fieldname is not simple one level name but multilevel name.
For example name="smth[field]" is easy way to test it
Reproduce code:
---------------
<form action="" method="GET"><input type="image"
name="smth[imgsubmit]"
src="t.jpg" width="200" height="200"></form>
<?php
print_r($_POST);
?>
Expected result:
----------------
Since single level image submits end up in post and get arrays as
fieldname_x and fieldname_y I would expect above code to produce GET
array as such:
Array ( [smth] => Array ( [imgsubmit_y] => 80, [imgsubmit_x] => 80 ) )
or even better would be actually
Array ( [smth] => Array ( [imgsubmit] => Array([x] => 80, [y] => 80) )
)
but it woul be a breaking change when changed to that and would be
inconsistent with single level fields, but also it would be much clearer
and would not prohibit me from having <input type="image"
name="someimage" src="..."> and <input type="hidden"
name="someimage_x"
value="previousvalue"> fields on same form at the same time
Actual result:
--------------
Array ( [smth] => Array ( [imgsubmit] => 80 ) )
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42960&edit=1