Weiss Posted October 22, 2017 Share Posted October 22, 2017 Hi. I wanna create a signup/login thingy. You can see it at sweiss.co.il/sfn/ . So i have the index.html with 2 forms 1 for login and 1 for signup, each has his own action going to login.php and signup.php , but i want them both leading to something like main.php only problem i dont know how to figure if the user clicked on the submit of the new user or the sumbit of the login as existent user (which obviously make main.php behave differently). Whats the best way to make it happen? Thanx very much in advance Link to comment Share on other sites More sharing options...
justsomeguy Posted October 23, 2017 Share Posted October 23, 2017 One way is to put a hidden form element in each form with a different value that you can check to find out which form was submitted. http://w3schools.invisionzone.com/topic/12509-php-tips-and-tutorials/?do=findComment&comment=96606 1 Link to comment Share on other sites More sharing options...
Dodra Posted October 24, 2017 Share Posted October 24, 2017 If both have a different submit button, simply do an if question: if (isset($_POST["login"])) { Do this } if (isset($_POST["register"])) { Do this } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now