How to place two forms on the same page?

后端 未结 6 967
借酒劲吻你
借酒劲吻你 2020-11-28 10:18

I want to place both register and login form on the same page.
They both starts with:

if (!empty($_POST)) ... 

so, I need something l

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 10:41

    Hope this will help you. Assumed that login form has: username and password inputs.

    if(isset($_POST['username']) && trim($_POST['username']) != "" && isset($_POST['password']) && trim($_POST['password']) != ""){
    //login
    } else {
    //register
    }
    

提交回复
热议问题