-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
65 lines (61 loc) · 1.45 KB
/
index.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
<?php
include_once 'scripts/blank.php';
$db = db();
$cookie = $_COOKIE["SECRET"];
$sql = "SELECT * FROM `user` WHERE `secret` = '$cookie'";
$res = $db->query($sql);
$user = mysqli_fetch_assoc($res);
$user = $user;
if(empty($cookie) || is_null($user)) {
$new_url = 'auth.php';
header('Location: '.$new_url);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php
head("Поля")
?>
</head>
<body>
<canvas id="sea-block" width="600" height="400">
Извините, ваш браузер нет поддерживает<canvas> элемент.
</canvas>
<div class="box">
<div class="main">
<header>
<div class="name">
<span class="material-symbols-outlined">sailing</span>
Sea Battle
</div>
<nav>
<a href="">Поля</a>
<a href="">Призы</a>
</nav>
<div class="avatar">
<p><?php echo $user['username']; ?></p>
<a id="exit"><span class="material-symbols-outlined">logout</span></a>
</div>
</header>
</div>
</div>
<script>
$("#exit").click(function(e) {
console.log("sexz")
$.ajax({
url: 'scripts/registrationorauth.php',
method: "post",
dataType: "html",
data: {"type":2},
success: function (data) {
console.log(data)
location.reload();
}
})
})
</script>
<!-- sea script -->
<script src="sea.js"></script>
</body>
</html>