-
Notifications
You must be signed in to change notification settings - Fork 0
/
Flogin.php
28 lines (24 loc) · 946 Bytes
/
Flogin.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
<?php
$F_USERNAME = $_POST['F_USERNAME'];
$F_PASWD = $_POST['F_PASWD'];
$conn = new mysqli('localhost', 'root', '', 'course_portal',3306);
if($conn->connect_error){
die('Connection Failed : ' . $conn->connect_error);
} else {
$stmt = $conn->prepare("select * from faculty where F_USERNAME=?");
$stmt->bind_param("s",$F_USERNAME);
$stmt->execute();
$stmt_result = $stmt->get_result();
if ($stmt_result->num_rows > 0) {
$data = $stmt_result->fetch_assoc();
if($data['F_PASWD']==$F_PASWD){
echo'<script> location.href="TRcourse.html"; </script>';
}
else{
echo '<script>alert("invalid username and password Please Try again"); location.href="facultylog.html";</script>';
}
}else{
echo '<script>alert("invalid username and password Please Try again"); location.href="facultylog.html"</script>';
}
}
?>