Sending form POST request to PHP

前端 未结 2 1426
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-26 16:22

I want to send a couple of form fields as a POST request to my PHP page, but I can\'t get it to work. Here is my code:

PHP login.php



        
2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-26 16:44

    Your inputs do not have names. The id is used for client-side referencing, but it is the (non-unique) name attribute that is used to determine the key for a value when the data is submitted. A form control cannot be successful (i.e. in the form data) without a name.

提交回复
热议问题