-
Notifications
You must be signed in to change notification settings - Fork 0
/
poll_token.php
63 lines (45 loc) · 1.47 KB
/
poll_token.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
<?php
include_once('database/connection.php');
include_once('database/polls.php');
include_once('lock.php');
include_once('templates/header.php');
include_once('templates/navbar.php');
if($_SERVER["REQUEST_METHOD"] == "POST") {
include_once('templates/validation/form_validation.php');
include_once('database/polls.php');
if(isset($_POST['token'])) {
$token = validateInput($_POST['token']);
$params = array('db' => $db, 'token' => $token);
$poll = getPollByToken($params);
if(isset($poll)) {
header('location: answer_poll.php?id= '.$poll['id']);
}
}
}
?>
<form role="form" method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<div class="panel panel-primary">
<div class="panel-heading">
<div class="panel-title">
<a class="close" href="user.php">×</a>
<p>Use your token.<p/>
</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-4">
<div class="input-group">
<input type="text" class="form-control" id="token" name="token" placeholder="Insert Your Token" style="text-align:center" maxlength="10" required/>
<span class="input-group-btn">
<input type="submit" value="Confirm" name="submit" class="btn btn-success"/>
</span>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<a href="user.php" class="btn btn-primary">Back</a>
</div>
</div>
</form>
<?php include_once('templates/footer.php'); ?>