forked from muhammadattaullahbhatti/School-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathverify.php
More file actions
40 lines (33 loc) · 645 Bytes
/
Copy pathverify.php
File metadata and controls
40 lines (33 loc) · 645 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
31
32
33
34
35
36
37
38
39
40
<?php session_start();
$temp=0;
$username = $_POST['user'];
$password = $_POST['pass'];
$con = mysqli_connect('localhost','root','','schoolmanagement');
if(mysqli_connect_error())
{
echo "Failed connection";
}
else
{
echo "connection established";
}
$sql = "SELECT * from admin where email='$username' and password='$password'";
$result = mysqli_query($con,$sql);
while ($row = mysqli_fetch_array($result))
{
if($row['email']==$username && $row['password']==$password)
{
$temp=1;
$_SESSION['auth']=$temp;
}
}
if($temp==1)
{
$_SESSION['username']=$username;
header("Location: dash.php");
}
else
{
echo "Unauthorized User";
}
?>