-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsave_player_changes.php
More file actions
90 lines (75 loc) · 2.2 KB
/
save_player_changes.php
File metadata and controls
90 lines (75 loc) · 2.2 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
<?php
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
date_default_timezone_set('Europe/Berlin');
session_start();
require('./logger.php');
require_once('./db.php');
$pid = $_SESSION['playerid'];
$pidtosave = isset($_GET["pidts"]) ? $_GET["pidts"] : "";
$playerName = isset($_GET["pn"]) ? $_GET["pn"] : "";
$pemail = isset($_GET["em"]) ? $_GET["em"] : "";
$newPw = isset($_GET["np"]) ? $_GET["np"] : "";
$newPwHash = isset($_GET["nph"]) ? $_GET["nph"] : "";
$newImage = isset($_GET["ni"]) ? $_GET["ni"] : "";
$newFaction = isset($_GET["nf"]) ? $_GET["nf"] : "";
echo "<!DOCTYPE html>\n";
echo "<html lang='en'>\n";
echo "<body>\n";
echo "<p style='font-family:Arial,sans-serif;font-size:14px;color:yellow;'>";
if (!empty($pidtosave)) {
echo "SAVING DATA...<br>";
echo $pidtosave."<br>";
echo $playerName."<br>";
echo $pemail."<br>";
echo $newPw."<br>";
echo $newImage."<br>";
echo $newFaction."<br>";
// playerid
// npc
// confirmed
// login_enabled
// name
// email
// password
// password_god
// password_phoenix
// admin
// godadmin
// image
// factionid
// hostedgameid
// gameid
// teamid
// commandid
// opfor
// bid_pv
// bid_tonnage
// bid_winner
// round
// active_ingame
// last_unit_opened
// last_login
// Updated
if ($newPw !== "") {
$hashedpw = password_hash($newPw, PASSWORD_DEFAULT);
$sql = "UPDATE asc_player SET name='".$playerName."',email='".$pemail."',password='".$hashedpw."',password_phoenix='".$newPwHash."',image='".$newImage."',factionid=".$newFaction." WHERE playerid=".$pidtosave;
} else {
$sql = "UPDATE asc_player SET name='".$playerName."',email='".$pemail."',image='".$newImage."',factionid=".$newFaction." WHERE playerid=".$pidtosave;
}
echo "Statement: " . $sql;
if (mysqli_query($conn, $sql)) {
echo "<br>";
echo "Record (asc_player) updated successfully";
mysqli_commit($conn);
echo "<script>top.window.location = './gui_show_playerlist.php'</script>";
} else {
echo "<br>";
echo "Error (asc_player) updating record: " . mysqli_error($conn);
}
}
echo "</p>\n";
echo "</body>\n";
echo "</html>\n";
?>