-
Notifications
You must be signed in to change notification settings - Fork 0
/
student_check.php
32 lines (29 loc) · 918 Bytes
/
student_check.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
<?php
include "db_connect.php";
session_start();
if (isset($_POST['student-email'])) {
$query="SELECT * FROM user WHERE Email='".$_POST['student-email']."' and password='".$_POST['student-pass']."'";
$result = mysqli_query($con,$query);
if (!$result){
die('Error: ' . mysqli_error());
}
else{
$array=mysqli_fetch_array($result,MYSQL_NUM);
if($array){
if($array[6]==1){
$_SESSION['login_student_username']=$_POST['student-email'];
header('Location:student.php');
}
else{
$_SESSION['student-notverified'] = "Student Not Verified";
header("Location:student.php");
}
}
else
{
$_SESSION['student-invalid']= "Invalid Email id or password";
header("Location:student.php");
}
}
}
?>