views:

361

answers:

4

When I hit the submit image I get some extra parameters in the GET request:

main.php?selected=user_manager_main&mode=set_active&set_this_id=13&x=4&y=7

Please note the x and y at the end. I certainly did not define the x and y at the end. The values seem to be random. Here is the form code:

echo '<form action ="main.php" method="get">';
echo '  <input type="hidden" name="selected" value="user_manager_main" />';
echo '  <input type="hidden" name="mode" value="set_inactive" />';
echo '  <input type="hidden" name="set_this_id" value="'.$row['USER_ID'].'" />';
echo '<input type="image" src="images/delete.gif" alt="Submit" />';
echo '</form>';

Any ideas? Thanks!

+9  A: 

It's the x and y coords of where the user clicked on your image input

Andrew G. Johnson
+6  A: 

It's not random. In IE, when you submit an input image, you get the coordinates where you cicked on the image.

zalew
That's not IE-specific but part of the HTML Candidate Recommendation.
Joey
+10  A: 

It's all ok. Look at:

http://www.w3.org/TR/html401/interact/forms.html#h-17.4.1

When a pointing device is used to click on the image, the form is submitted and the click coordinates passed to the server. The x value is measured in pixels from the left of the image, and the y value in pixels from the top of the image. The submitted data includes name.x=x-value and name.y=y-value where "name" is the value of the name attribute, and x-value and y-value are the x and y coordinate values, respectively.

Thinker
+1  A: 

It's the coordinates inside the image where the user clicked. With the value x=4 and y=7 the user clicked four pixels from the left edge of the image and seven pixels from the top edge.

The key names for the coordinate values are formed by adding ".x" and ".y" to the name of the image button. As you haven't specified any name at all, the key names simply become "x" and "y".

Guffa