I try to get this login page running.
My problem is that i never reach the line:
header("location: questions1.php");
Im pretty sure its the if() but i tried many things and nothing is working.
My loggin is fine. I just wanna check that there is somthing in mail and pw and than go to the next page.
<!DOCTYPE html>
<html lang="de">
<head>
<title>Login</title>
</head>
<body>
<div content="php">
<?php
if (isset($_POST['login']) && !empty($_POST['mail']) && !empty($_POST['pw'])) {
header("location: questions1.php");
}
?>
</div>
<form action="" method="post">
<p>E-Mail:<input type="text" name="mail" required/></p>
<p>Password:<input type="password" name="pw" required/></p>
<button type="submit" name="login">Login</button>
</form>
</body>
</html>
The header line works well i set the if to true but i need to check if mail and pw are set befor.