-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkwho.php
109 lines (86 loc) · 2.12 KB
/
checkwho.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
session_start();
$sid=$_POST['sid'];
$password=$_POST['password'];
$con=mysqli_connect('localhost','root','','titanpro');
$sql="select * from student where sid='$sid' && password='$password'";
$run=mysqli_query($con,$sql);
$row=mysqli_num_rows($run);
echo "".$row;
$status=0;
if($row==1)
{
for($n=1;$n<=2;$n++)
{
$row=0;
echo "n=".$n;
$sql="select * from student where sid='$sid' && password='$password' && status='$n'";
$run=mysqli_query($con,$sql);
$row=mysqli_num_rows($run);
$_SESSION["sid"] = $sid;
if($row==1 && $n==2)
{
header ("Location:http://localhost/zat/admin/index.php");
}
if($row==1 && $n==1)
{
header ("Location:http://localhost/zat/user/index.php");
}
}
?>
<script type="text/javascript" >
window.alert("Your account has been Block!!");
window.location.href='login.php';
</script>
<?php
}
else
{
?>
<script type="text/javascript" >
window.alert("Invalid User ID or Password...,");
window.location.href='login.php';
</script>
<?php
}
/*
if($row==1)
{
$_SESSION["sid"] = $sid;
if($row['status']==1)
{
header ("Location:user/user.php");
}
if($row['status']==2)
{
header ("Location:admin/admin.php");
}
if($row['status']==0)
{
?>
<script type="text/javascript" >
window.alert("Your account Block !! Please Note to help Admin !!");
window.location.href='login.php';
</script>
<?php
}
}/*
$sql="select * from admin where sid='$sid' && password='$password'";
$run=mysqli_query($con,$sql);
$row=mysqli_num_rows($run);
echo "".$row;
if($row==1)
{
$_SESSION["sid"] = $sid;
header ("Location:admin/home.php");
}
*/
/*else
{/*?>
<script type="text/javascript" >
window.alert("Invalid User ID or Password...,");
window.location.href='login.php';
</script>
<?php
}*/
?>