Forum Moderators: open

Message Too Old, No Replies

Form response showing unnecessary items

         

walrus1

1:48 pm on Dec 10, 2004 (gmt 0)

10+ Year Member



Hi Guys. I'm not sure why my form responses always have

imageField_x:
13

imageField_y:
8

or similar at the bottom of the emails that I receive. I have tried to search for an answer but can't find a thing. Do these unsightly things have to be shown on the email or can I edit the html someway to prevent this happening? Any help much appreciated.

Cheers
Lance

dcrombie

4:10 pm on Dec 10, 2004 (gmt 0)



If you use an <INPUT type="image" name="foo"> to submit your form then the browser automatically passes the x- and y-coordinates of your click along with the GET/POST data.

ie. foo.x and foo.y indicate where in the button you clicked

This is mainly used for mapping applications where you need to zoom and/or pan within a map by clicking.

PHP converts the variable names to foo_x and foo_y.

It sounds like your emailer is passing ALL form information. If you can edit the script you're using, add something like this at the start of the code (this is PHP code so you might have to translate it to whatever language you're using):

foreach($_POST as $key => $val) { 
if(preg_match("/_(x¦y)$/", $key)) unset($_POST[$key]);
}

;)