-
Notifications
You must be signed in to change notification settings - Fork 2
/
login.php
33 lines (32 loc) · 842 Bytes
/
login.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
$Email=$_POST['email'];
$Password=$_POST['password'];
$con = new mysqli("localhost","root","","expensave");
if($con->connect_error)
{
die("Failed to connect: ".$con->connect_error);
}
else
{
$stmt=$con->prepare("SELECT * FROM tbluser WHERE Email = ?");
$stmt->bind_param("s",$Email);
$stmt->execute;
$stmt_result=$stmt->get_result();
if($stmt_result->num_rows>0)
{
$data=$stmt_result->fetch_assoc();
if($data['Password']===$Password)
{
echo "<h2> Login Successful</h2>";
}
else
{
echo "<h2 Invalid Email or Password</h2>";
}
}
else
{
echo "<h2 Invalid Email or Password</h2>";
}
}
?>