-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhost.php
145 lines (114 loc) · 4.98 KB
/
host.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
session_start();
// echo $_SESSION['quizstatus'];
?>
<!DOCTYPE html>
<html>
<head>
<title>host your quiz</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
</head>
<body onload="dbsize();">
<div class="container text-center border mt-4 card shadow bg-light rounded-pill">
<nav class="navbar ">
<a class="navbar-brand " href="index.php">
<img src="Vexels-Office-Bulb.svg" width="30" height="30" class="d-inline-block align-top" alt="">
WIA QUIZ APPLICATION
</a>
<?php
if(isset($_SESSION['username'])){ ?>
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<?php echo $_SESSION['username']; ?>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenu2">
<a href="userprofile.php"><button class="dropdown-item" type="button">Profile</button></a>
<a href="logout.php"><button class="dropdown-item" type="button">Logout</button></a>
</div>
</div>
<?php
} ?>
</nav>
</div>
<div class="container border mt-4 p-4 shadow card bg-light">
<div class="ml-4 mt-3 mr-5 col-5 align-top">
<h2 >HOST YOUR QUIZ</h2>
<hr>
<br>
<form action = "make_questions.php" method= "post" >
<div class="form-group ">
<label for="qid">Enter your Quiz name</label>
<input type="text" class="form-control" id="qid" name="qname" required="">
</div>
<div class="form-group">
<label for="quizcode">Enter quiz code </label>
<input type="text" class="form-control" pattern="[A-Za-z]{4,9}" title="only characters are allowed and length must be b/w 4 to 9 " id="quizcode" name="tqname" required="please enter some quiz code" >
<?php
if(!isset($_SESSION['quizstatus']))
{
?>
<small class=" form-text text-muted">Quiz code must be unique.</small><?php
}
else if($_SESSION['quizstatus']==1)
{
?>
<small class=" form-text text-warning ">This quiz code already exist.</small>
<?php
unset($_SESSION['quizstatus']);
}
?>
</div>
<div class="form-group ">
<label for="numofquestions">Enter no of questions in the quiz</label>
<input type="number" class="form-control" id="numofquestions" name="numofque" required="">
</div>
<div class="form-group ">
<label for="numofoptions">Enter no of options in one question</label>
<input type="number" class="form-control" id="numofoptions" name="numofopt" required="">
</div>
<div class="form-group ">
<label for="timelimit">Enter time limit of quiz (in minutes)</label>
<input type="number" class="form-control" id="timelimit" name="timelimit">
</div>
<div >
<button type="submit" class="btn btn-primary text-center">Next</button>
</div>
</form>
<?php
?>
</div>
</div>
<script type="text/javascript">
function dbsize(){
<?php
if($_SESSION['dbsize']==1)
{
?>
alert("database size is fulll , do message to admin for help!!");
<?php
}
?>
}
</script>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</body>
</html>