$_POST is not working in ajax form submit?

后端 未结 11 1582
遥遥无期
遥遥无期 2021-01-17 12:57

When I try to check user input name is already exist by ajax form submit !But it only get Undefined index: username in sessions.php ,what is missin

11条回答
  •  执念已碎
    2021-01-17 13:50

    You need to change your script:

    Try using new FormData instead of .serialize().

    
    

    Note : You are used contentType to false that mean jQuery not to add a Content-Type header. You are using jQuery's .serialize() method which creates a text string in standard URL-encoded notation. You need to pass un-encoded data when using "contentType: false".

提交回复
热议问题