What i want: clicking on login / pressing on enter will validate the login and redirect if correct (without javascript).
What i tried:
- A form with a submit button and validating on an other php page PROBLEM: if login is not correct, i don't want to redirect and display an error message instead.
<form action="loginServerside.php" method='POST'>
- A form with a submit button and validating when the submit button is set. PROBLEM: submit button reloads page and then redirects if login was correct
<form method='POST'> <input name="email" type="email" id="email" placeholder="Email" /> <input name="pass" type="password" id="pass" placeholder="Password"> <input type="submit" name='login' value="LOGIN" id="login" class="button"/> </form> if (isset($_POST['login'])) /*validate*/
- Trying to prevent the page reload by using an input type="button" PROBLEM: the isset only works for submit buttons
I would appreciate the help!