-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
102 lines (89 loc) · 2.55 KB
/
index.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
<html>
<head>
<title>Wel come to Online Exam</title>
<link rel="stylesheet" type="text/css" href="admin.css">
</head>
<body background="bg1.jpg">
<?php
session_start();
session_unset();
include("header.php");
include("database.php");
extract($_POST);
if(isset($submit))
{
//echo "ADmin CHeck :".$admin;
if($admin)
{
$rs=mysql_query("select * from mst_admin where loginid='$loginid' and pass='$pass'") or die(mysql_error());
//echo mysql_fetch_array($rs)['loginid'];
if(mysql_num_rows($rs)<1)
{
echo "<BR><BR><BR><BR><div class=head1> Invalid User Name or Password<div>";
exit;
}
$_SESSION['alogin']="true";
header("Location: /exam/admin/login.php");
}
else{
$rs=mysql_query("select * from mst_user where login='$loginid' and pass='$pass'");
if(mysql_num_rows($rs)<1)
{
$found="N";
}
else
{
$_SESSION['login']=$loginid;
}
}
if (isset($_SESSION[login]))
{
header("Location: /exam/index2.php");
exit;
}
}
?>
<center><table width="100%" border="0">
<tr>
<td width="70%" > </td>
<td bgcolor="#90EE90"><div align="center" class="button"><h4>User Login </h4></div></td>
</tr>
<td height="100" align="top">
<div align="center">
<td align="top"><form name="form1" method="post" ></center>
<table width="420" >
<tr>
<td><span class="button">Login ID </span></td>
<td><input name="loginid" type="text" id="loginid2"></td>
</tr>
<tr>
<td><span class="button">Password</span></td>
<td><input name="pass" type="password" id="pass2"></td>
</tr>
<tr>
<td colspan="2"><span class="errors">
<?php
if(isset($found))
{
echo "Invalid Username or Password";
}
?>
</span>
</td>
</tr>
<tr>
<td colspan=8 align=center class="button">
<input type="checkbox" name="admin" value="Bike">Login as Admin <br>
<button name="submit" type="submit" id="submit" valur="login" >Login</button>
</td>
</tr>
<tr>
<td colspan="4"><div align="center"><span class="button">New User ? <a href="signup.php"><button name =" Click here for Signup" type= "button">Click here for Signup</button></a></span></div></td>
</tr>
</table>
</form>
</td>
</tr>
</table></center>
</body>
</html>