-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser-2.php
More file actions
30 lines (26 loc) · 847 Bytes
/
Copy pathuser-2.php
File metadata and controls
30 lines (26 loc) · 847 Bytes
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
<?php
$email = $_POST['email'];
$password = $_POST['password'];
$con = new mysqli('localhost','root','','Register');
if($con->connect_error){
echo "$con->connect_error";
die("Connection Failed : ".$con->connect_error);
} else {
$stmt = $con->prepare("select * from Registration 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 Successfully</h2>";
}else{
echo"<h2>Invalid Email or password</h2>";
}
}else{
echo"<h2>Invalid Email or password</h2>";
}
}
$stmt->close();
$conn->close();
?>