PHP & MySQL username submit problem

后端 未结 2 1059
迷失自我
迷失自我 2021-01-29 00:51

I want to allow users to either have there username field empty at any time but I get the username error message Your username is unavailable! how can I correct thi

相关标签:
2条回答
  • 2021-01-29 01:01
    if(isset($_POST['username']) && trim($_POST['username'])!=='') {
    

    Otherwise, $_POST['username'] will be set even if the form is submitted with an empty field.

    0 讨论(0)
  • 2021-01-29 01:18
    if(isset($_POST['username']) && !empty($_POST['username'])) {
    ...
    
    0 讨论(0)
提交回复
热议问题