SoFunction
Updated on 2025-04-04

Get the name value passed by the image button in php

I need to use the image button to beautify my web, but using the connection delivery method will show variable values ​​in the browsing bar, which will make it uncomfortable. If you use hidden to submit it, you don't feel it is necessary, because since the image has the name attribute, it should be able to get it, why do you need to add an extra variable? I posted it in BBS for several days but no one answered it. I could only read the book and figure it out, and later I found it!

If the image in the form is submitted, two related variables will be generated, such as:
<input type=image src="..." name=aaa>
Then, two variables will be generated during the commit process, aaa_x and aaa_y
It contains the specific locations of the picture on the screen x and y
Then in php, just judge aaa_x and aaa_y

No hidden domains, javascript, and connection value transfer behavior is required!

The test has been passed, everyone is welcome to test it. If you have any questions, please contact me!