I am trying to make a simple login form but I can not make it work. I have tried different things and searched for answers but nothing seems to be working. When I press the login button nothing happens its like there is no code for it.
here is the code I used:
<?php require 'Connections/Connections.php';?>
<?php
if(isset($_POST['Login'])){
$EM = $_POST['email'];
$PW = $_POST['pwd'];
$result = $con->query("SELECT email, pwd WHERE email=$EM and pwd='$PW'");
$row = $result->fetch_array(MYSQLI_BOTH);
session_start();
$_SESSION["user_id"] = $row['user_id'];
header('Location: account.php');
}
?>
<html>
<head>
<title>Social</title>
<link rel="stylesheet" href="css/signin.css">
</head>
<body>
<div id="form">
<form id ="form1">
<input class="paper" type="email" name="email" id="email" required="required" placeholder="E-mail:"><br>
<input class="paper1" type="password" name="pwd" id="pwd" required="required" placeholder="Password:">
<button name="Login" id="login" value="Submit" type="submit">Login</button>
</form>
<form id="form2" action="register.php" method="get">
<button name="register" id="button2" value="submit" type="submit">Register</button>
</form>
</div>
<!-- <img id="logo" src="logo1.png">-->
</body>
</html>
and here is what the required file has in it:
<?php
$con = mysqli_connect("localhost","root","","phplogin");
?>