php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66723 Translation of Postdata at <input type="image" ... >
Submitted: 2014-02-16 09:56 UTC Modified: 2014-03-27 13:35 UTC
From: tschmieder at online dot de Assigned: ab (profile)
Status: Closed Package: *Programming Data Structures
PHP Version: 5.4.25 OS: Linux, Windows, ...
Private report: No CVE-ID: None
 [2014-02-16 09:56 UTC] tschmieder at online dot de
Description:
------------
I often prefer to use for input elements namestrings in array notation, similar to 

echo '<input type="image" src="/img/lupe.gif" name="btn[show][' . $id . ']">';

This is very handy, unfortunately it doesn't work when Input-Type = Image.

Result will be:
Array
(
    [btn] => Array
        (
            [show] => Array
                (
                    [3] => 9
                )

        )
)

Looking into the http-transfer, everything is still ok:

 Content-Disposition: form-data; name="btn[show][1].x"
 Content-Disposition: form-data; name="btn[show][1].y"

Due to the "point substitution" in combination with the array spelling, the x-coordinate will be replaced by the y-coordinate



Expected result:
----------------
I would be glad, if for further PHP-Versions the result could be:

(
    [btn] => Array
        (
            [show] => Array
                (
                    [3] => Array
                      {
                          [x] => 9
                          [y] => 27
                      } 
                )
        )
)

For compatibility reasons, the translation for simple names perhaps should remain the same
 
  <input type="image" name="image" ... >

becomes furthermore to

   $_POST['image_x'] = 9
   $_POST['image_y'] = 27




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-03-27 13:35 UTC] ab@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2014-03-27 13:35 UTC] ab@php.net
Actually, that's not a bug, but rather a feature request which you might want to keep. I personally doubt it to be really useful. There can be only one submit button anyway. And especially for image submit - it's already handled special way, so why it needs another special handling?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC