Bug #66723 [Opn->Csd]: Translation of Postdata at <input type="image" ... >

From: Date: Thu, 27 Mar 2014 13:35:06 +0000
Subject: Bug #66723 [Opn->Csd]: Translation of Postdata at <input type="image" ... >
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184931@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66723&edit=1

 ID:                 66723
 Updated by:         ab@php.net
 Reported by:        tschmieder at online dot de
 Summary:            Translation of Postdata at <input type="image" ... >
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            *Programming Data Structures
 Operating System:   Linux, Windows, ...
 PHP Version:        5.4.25
-Assigned To:        
+Assigned To:        ab
 Block user comment: N
 Private report:     N

 New Comment:

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?


Previous Comments:
------------------------------------------------------------------------
[2014-02-16 09:56:11] 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





------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=66723&edit=1


Thread (2 messages)

« previous php.bugs (#184931) next »