Code working in Chrome but not in Firefox

后端 未结 2 1321
遇见更好的自我
遇见更好的自我 2021-01-16 06:13

The following code works in Chrome. But in Firefox the submit step is not working


2条回答
  •  灰色年华
    2021-01-16 06:36

    The issue is that an image submit doesn't send the name "submit" it sends "submit_x" and "submit_y"

    So you should check for

    if (isset($_POST['submit_x']))...
    

    EDIT: I've done a little more testing on this and it appears in Firefox (16) and IE(7, 8, 9) only the x and y get sent whereas in Chrome (23) and Safari (5.1) it also send the name too along with x and y.

    So the safest way is to check for the value is : isset($_POST['name_x'])

提交回复
热议问题