-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmain.php.bk
More file actions
50 lines (42 loc) · 1.42 KB
/
main.php.bk
File metadata and controls
50 lines (42 loc) · 1.42 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
<?php
require __DIR__.'/../_ensure_https.php';
//Stop Direct Access to the File
//Works only in PHP 5.0 and Up
if (get_included_files()[0] == __FILE__) {exit("<h1>Access Denied</h1>");}
//Stop Including This File Twice
if (defined(strtoupper(basename(__FILE__,".php"))."_PHP")) {return True;}
define(strtoupper(basename(__FILE__,".php"))."_PHP", True);
//JSON input
if ($_SERVER["REQUEST_METHOD"] == "POST" and $_SERVER["CONTENT_TYPE"] == "application/json") {
$json = file_get_contents("php://input");
$_POST = json_decode($json, True);
}
//Prevent XSS Injection by HTML Special Chars All Inputs
foreach ($_POST as $key => $value) {
if (gettype($_POST[$key]) == "string") {
$_POST[$key] = htmlspecialchars($value);
}
}
foreach ($_GET as $key => $value) {
if (gettype($_GET[$key]) == "string") {
$_GET[$key] = htmlspecialchars($value);
}
}
//Output JSON Error
function jsonError($err, $data = NULL)
{
if ($data) {
echo json_encode(["Error" => $err, "Data" => $data]);
exit();
}
echo json_encode(["Error" => $err]);
exit();
}
$isMobile = (strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'mobile') || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'android'));
//Constants
$socketurl = "bloxpvp.com";
$maxGameItems = 100;
$minimumTotalTaxItems = 4; // Set To Above maxGameItems * 2 to Disable
$minimumTotalTaxValue = 50;
$taxRecieverId = 1;
?>