There are two problems:
1. The image button is different from the normal button. js is used to simulate the submission operation.
2. During the get button operation in php, the normal isset ($ _ POST [object name]) cannot be obtained. After print_r ($ _ POST), it is found that:
Array ([btn_reg_x] => 81 [btn_reg_y] => 27)
After checking the information, we found that:
$ _ POST [thisname_x] -- click the X position of the image
$ _ POST [thisname_y] -- click the Y position of the image
Therefore, modify the submitted code of the original client:
<Script type = "text/javascript">
Function SubmitOne ()
{
$ ("MyForm"). submit ();
}
</Script>
<Input type = "image" src = "images/**. jpg" id = "btn_reg" name = "btn_reg" onclick = "SubmitOne ();"/>
Php code changed:
If (isset ($ _ POST [btn_reg_x]) // or (isset ($ _ POST [btn_reg_y])
{
Echo OK! Thats right .;
}