-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.php
86 lines (63 loc) · 1.79 KB
/
user.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
<?php
require('class/header.php');
if(!isset($_SESSION['user']))
{
echo "<script>alert('you need login first!')</script>";
echo "<script>window.location.href='./index.php'</script>";
exit;
}
$user = $_SESSION['user'];
$req = select($user);
if(empty($req['email'])){
$email = 'None';
}else{
$email = $req['email'];
}
if(empty($req['message'])){
$message = 'None';
}else{
$message = $req['message'];
}
$csrftoken = substr(md5($user.createRandomStr(8)),4,8);
$_SESSION['csrftoken'] = $csrftoken;
?>
<div class='col-md-8 col-md-offset-2 text-center head' id="head">
<h1>the deserted place</h1>
</div>
<div id='hide' class='col-md-8 col-md-offset-2 text-center'><h2 class='animated fadeInUp delay-05s white'>Welcome to deserted place</h2></div>
<div class="container back">
<?php
print <<<EOT
<div class="list-group-item warn">
<h3>
Tips:
</h3>
<p>
Hello {$user}, Welcome to the deserted place, there's nothing here, and try to find something. And if you find some bug, you can <a href="./report.php" style="margin-left:0px">report bug</a> to admin.
</p>
</div>
EOT;
?>
<div class="list-group-item main">
<div class="list" style="float:left">
<ul class='list-group'>
<li class="list-group-item" id="user">Username: <?=htmlspecialchars($user)?></li>
<li class="list-group-item" id="email">Email: <?=$email?></li>
<li class="list-group-item" id="mess">Message: <?=$message?></li>
<li class="list-group-item" id="csrft" style="display: none">csrftoken: <?=$csrftoken?></li>
</ul>
</div>
<div class="cimg" style="float:left">
<div class="bimg">
<img src="./static/e.png" onclick=edit()>
<h4>change something</h4>
</div>
<div class="bimg">
<img src="./static/c.png" onclick=random()>
<h4>click me</h4>
</div>
</div>
<?php
$db->close();
require('class/footer.php');
?>