-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
119 lines (96 loc) · 2.9 KB
/
index.php
File metadata and controls
119 lines (96 loc) · 2.9 KB
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
110
111
112
113
114
115
116
117
118
119
<?PHP
require_once "./required/class.php";
if(isset($_SESSION['admin'])){
echo 'redirecting... <br /> if you are not redirected within 5 seconds please <a href=\'main.php?page=main\'>click here</a>';
refresh('./pages/main.php?page=main');
}
else{
require_once './pages/mainval.php';
require_once './required/database.php';
/*connectdb(); */
$con= new db_mysql();
$action = $_GET['action'];
if($action == "signin")
{
$name = $_POST['txtUname'];
$pass = $_POST['txtPass'];
$sql = "SELECT * FROM `login` WHERE Username='$name' AND Pass_Word='$pass'";
// echo $sql;
$rs = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($rs);
$count = mysql_num_rows($rs);
if( $count == 1){
$_SESSION['admin'] = $name;
$_SESSION['Level'] = $row['Level'];
refresh('./pages/main.php?page=admin');
}
else{
$error_message= "Username/Password Invalid";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="css/css.css" type="text/css" charset="utf-8" />
<?PHP include_once "header.php"; ?>
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="logo">
<h1>iigal's work</h1>
<p>Online Marksheet System</p>
</div>
</div>
<style type="text/css">@import url(./css/css.css);</style>
<body>
<center>
<div id="wrapper_index">
<div id="body">
<form action="index.php?action=signin" method="post" name="frmAdminLogin">
<center><table cellpadding="0" cellspacing="0" border="0">
<tr><td colspan="3" height="14px"></td></tr>
<tr>
<td class="headin" colspan="3" height="22px"><b>Eagles Solution Login</b></td>
</tr>
<tr>
<td colspan="3" height="5px"></td>
</tr>
<tr>
<td class="label">UserName:</td>
<td width="5px"></td>
<td ><input class="txtBoxes" type="text" name="txtUname"></td>
</tr>
<tr>
<td colspan="3" height="3px"></td>
</tr>
<tr>
<td class="label">Password:</td>
<td width="5px"></td>
<td width="120px"><input class="txtBoxes" type="password" name="txtPass"></td>
</tr>
<tr>
<td colspan="3" height="3px"></td>
</tr>
<tr>
<td colspan="3" style="text-align:right;"><input class="buttons" type="submit" name="btnLogin" value="Sign In" id="btn"></td>
</tr>
<tr>
<td colspan="3" width="20"> </td>
</tr>
<tr>
<td colspan="3" class="error">
<?php if(isset($error_message))
print "<b><font face='Arial, Helvetica, sans-serif' size='2' color='#ff0000'>$error_message</font></b>"?></td>
</tr>
</table></center>
</form>
</div>
</div>
<?PHP include ("./footer.php"); ?>
</center>
</body>
<?PHP } ?>