In my HTML I have a form where users can register or login.The problem is both Register and Login buttons are in the same form, and they are handled by two scripts: register.php and login.php.
In
<form action=" ">
there could just be one script name. So how to make the form able to handle two submit buttons(two scripts)?
<form action="register.php" method="post" class="login_form">
<div class="login_form_input_container">
<label for="email" class="login_form_label">Email</label>
<input type="email" id="email" name="email" class="login_form_input">
</div>
<div class="login_form_input_container">
<label for="password" class="login_form_label">Password</label>
<input type="password" id="password" name="password" class="login_form_input">
</div>
<a href="forgot_password/" class="forgot_password_link">Forgot password?</a>
<input type="submit" id="login_submit" name="login_submit" value="Log In" class="login_form_submit">
<input type="submit" id="register_submit" name="register_submit" value="Register" class="login_form_submit">
</form>
if (isset($_POST['btn_name']))
– u_mulder