-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
94 lines (77 loc) · 3.01 KB
/
index.php
File metadata and controls
94 lines (77 loc) · 3.01 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
<?php
$config = include('config.php');
/*
$web_lobby_url = "";
$web_lobby_url .= $config['web_lobby'];
$web_lobby_url .= "operator_token=" . $config['operator_token'] . "&";
$web_lobby_url .= "operator_player_session=" . urlencode($config['operator_player_session']) . "&";
$web_lobby_url .= "language=" . $config['language'];
$web_lobby_url .= "";
*/
?>
<!DOCTYPE html>
<html lang="th" class="">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noodp">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
</head>
<body>
<form method="POST" id="login">
<label for="phone">Phone : </label><input type="text" name="phone" id="phone" />
<br class="clear" />
<label for="password">Password : </label><input type="password" name="password" id="password" />
<br class="clear" />
<button type="submit" id="btn-submit">เข้าสู่ระบบ</button>
</form><BR><BR>
<button onclick="window.location.href='/demo-pg'">ทดลองเล่น</button><BR><BR>
<button onclick="window.location.href='<?=$config['host']?>/register';">สมัครสมาชิก</button><BR><BR>
<?php
include(dirname(__FILE__).'/template/footer_js.php');
?>
<script>
$("#login").submit(function(e) {
e.preventDefault();
$.post('/exec/login.php', $(this).serialize(), function(data) {
$("#alerts").html(data)
});
});
</script>
</body>
</html>
<?php
//require_once '../config.php';
/*
$web_lobby_url = "<script>window.location = '";
$web_lobby_url .= $config['web_lobby'];
$web_lobby_url .= "operator_token=" . $config['operator_token'] . "&";
$web_lobby_url .= "operator_player_session=" . urlencode($config['operator_player_session']) . "&";
$web_lobby_url .= "language=" . $config['language'];
$web_lobby_url .= "'</script>";
*/
//echo "<script>window.location = '" . $web_lobby_url . "'</script>";
//echo $web_lobby_url;
/*
if (isset($_POST['phone']) and isset($_POST['password'])) {
$phone = trim($_POST['phone']);
$password = trim($_POST['password']);
$stmt = $mysqli->prepare("SELECT `member_username` FROM `members` WHERE `member_phone` = ? AND `member_password` = ?");
$stmt->bind_param("ss", $phone, $password);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0) {
$stmt->bind_result($username);
$stmt->fetch();
$_SESSION['username'] = $username;
echo "<script>window.location = 'profile.php'</script>";
}else{
echo "<script>Swal.fire(
'เข้าสู่ระบบไม่สำเร็จ',
'กรุณาตรวจสอบเบอร์โทรและรหัสผ่านอีกครั้ง',
'error'
)</script>";
}
}*/
?>