note 63295 added to language.variables.external
| From: | ch1902uk at hotmail dot com | Date: | Sat, 18 Mar 2006 19:47:35 +0000 |
| Subject: | note 63295 added to language.variables.external | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-106045@lists.php.net to get a copy of this message | ||
Regarding image input buttons, above where it says:
"When the user clicks somewhere on the image, the accompanying form will be transmitted to the
server with two *additional* variables, sub_x and sub_y. These contain the coordinates of the user
click within the image."
This is the case with Firefox (and probably other standards browsers), however my experience with
Internet Explorer is that when image inputs are clicked, they only submit the location of the click
on the button and *not* the name of the input.
So if you have a form to move/delete entries like this
entry[] [delete_0] [up_0] [down_0]
entry[] [delete_1] [up_1] [down_1]
entry[] [delete_2] [up_2] [down_2]
Then submitting the form in firefox will give you post variables such as
<?php
$_POST['delete_2']; // "Delete" - button value
$_POST['delete_2_x']; // 23 - x coord
$_POST['delete_2_y']; // 3 - y coord
?>
In IE you only get
<?php
$_POST['delete_2_x']; // 23 - x coord
$_POST['delete_2_y']; // 3 - y coord
?>
So if you are checking for what button was clicked do something like this
<?php
for ($i = 0; $i < count($_POST['entry']); $i++)
{
if (isset($_POST['delete_' . $i . '_x']))
{
// do delete
}
}
?>
----
Server IP: 216.194.113.175
Probable Submitter: 86.140.200.54
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/language.variables.external.php
Edit -- http://master.php.net/note/edit/63295
Del: integrated -- http://master.php.net/note/delete/63295/integrated
Del: useless -- http://master.php.net/note/delete/63295/useless
Del: bad code -- http://master.php.net/note/delete/63295/bad+code
Del: spam -- http://master.php.net/note/delete/63295/spam
Del: non-english -- http://master.php.net/note/delete/63295/non-english
Del: in docs -- http://master.php.net/note/delete/63295/in+docs
Del: other reasons-- http://master.php.net/note/delete/63295
Reject -- http://master.php.net/note/reject/63295
Search -- http://master.php.net/manage/user-notes.php