-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheck_auth.php
More file actions
30 lines (25 loc) · 756 Bytes
/
Copy pathcheck_auth.php
File metadata and controls
30 lines (25 loc) · 756 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
include "connection.php";
session_start();
if(isset($_POST["email"]) && isset($_POST["pass"])) {
$email = $_POST["email"];
$pass = $_POST["pass"];
$rpass="";
$sql="SELECT password FROM useracc WHERE email='$email'";
$result = mysqli_query($conn,$sql);
if($result->num_rows > 0)
{
while($row = $result->fetch_assoc())
{
$rpass= $row['password'];
}
}
if($rpass==$pass){
$_SESSION["user"]=$email;
header("Location: home.php");
}
else{
echo "<script>alert('Oops! Incorrect email or password');window.location.replace('index.php')</script>";
}
}
?>