-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsingleuser.php
More file actions
115 lines (84 loc) · 2.03 KB
/
singleuser.php
File metadata and controls
115 lines (84 loc) · 2.03 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Online Examination</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="style3"></div><div class="style_2"><span class="style3">
<a href="#" title="Online Exam"><strong>For Adroid</strong></a></span>
</div>
<div id="wrap">
<div id="topbar">
<h1 id="sitename"><a href="#">Online Examination </a></h1>
<div id="menus">
<ul id="topmenu">
<li class="active"><a href="#">Home</a>
</li>
<li><a href="createmultipleusers.html">Create Users</a>
</li>
<li><a href="createTest.html">Create Test</a>
</li>
<li><a href="UploadQuestions.html">Upload Questions</a>
</li>
</ul>
</div>
</div>
<div id="header">
</div>
<div id="content">
<div id="mainpage">
<?php
session_start();
if($_SESSION['myusername'] == "" | $_SESSION['myusername'] == null)
{
header("location: index.php");
}
?>
<?php
require_once('dbconnect.php');
$username = $_POST["uname"];
$password = $_POST["pass"];
$t = $_POST["type"];
$password = md5($password);
$result1 = mysqli_query($con," SELECT max(userid) FROM users ");
$row = mysqli_fetch_array($result1);
$uid = $row[0] + 1;
$result = mysqli_query($con,"INSERT INTO users(userid,username,password,utype) VALUES($uid,'$username','$password','$t')");
if($result)
{
echo "<h2>User Created</h2>";
}
else
{
echo "<h2>User already exist!</h2>";
}
mysqli_close($con);
?>
</div>
<div id="sidebar">
</div>
<div id="sidebarcontents">
<ul id="menu">
<li>
<h2>Admin Controll</h2>
</li>
<li>
<ul><li><a href="createmultipleusers.html">Create User</a></li>
<li><a href="createTest.html">Create Test</a></li>
<li><a href="UploadQuestions.html">Upload Questions</a></li>
</ul>
</li>
</ul>
</div>
<div id="sidebarbottom"></div>
</div>
<div class="clear"></div>
</div>
</div>
<div id="footer">
<p>Copyright © 2013 | Online Examination For Android Devices.</p>
</div>
</body>
</html>