How to place two forms on the same page?

后端 未结 6 976
借酒劲吻你
借酒劲吻你 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

    You could make two forms with 2 different actions


    Or do this


    Then you PHP file would work as a switch($_POST['action']) ... furthermore, they can't click on both links at the same time or make a simultaneous request, each submit is a separate request.

    Your PHP would then go on with the switch logic or have different php files doing a login procedure then a registration procedure

提交回复
热议问题