Can't find an input type=image value in $_POST

后端 未结 5 2189
故里飘歌
故里飘歌 2020-12-20 03:08

Well may be it is to easy question but:

I want to sort the numbers by clicking an image. I thought that i make a form and add an imagefield.

5条回答
  •  我在风中等你
    2020-12-20 04:07

    If I am reading the question properly, then having the image as part of the form does not automatically submit the form as POST. The button made it work because you were actually submitting the form.

    When you initially load the page, it will be a GET request with no relation to the form that you are showing us (and you could have numerous other forms in the page using different names, that would similarly have no effect unless submitted themselves). When you submit using the button, it requests index.php and adds the POST parameters.

    Try adding onsubmit="submit-form();" to the input element?

提交回复
热议问题