-
Notifications
You must be signed in to change notification settings - Fork 0
/
hp_handler.php
33 lines (28 loc) · 992 Bytes
/
hp_handler.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
<?php
include "db_connect.php";
if (isset($_POST['newHP'])): {
$newHP = $_POST['newHP'];
$characterid = $_POST['characterid'];
$sql = "UPDATE `characters` SET `Curr_HP` = ? WHERE `character_id` LIKE ?";
if ($stmt = mysqli_prepare($conn, $sql)) {
mysqli_stmt_bind_param($stmt, "ii", $newHP, $characterid);
mysqli_stmt_execute($stmt);
// echo "Remove foreign key to signature-attack-2";
}
echo $newHP;
} elseif (isset($_POST['tempHP'])): {
$tempHP = $_POST['tempHP'];
$characterid = $_POST['characterid'];
$sql = "UPDATE `characters` SET `TempHP` = ? WHERE `character_id` LIKE ?";
if ($stmt = mysqli_prepare($conn, $sql)) {
mysqli_stmt_bind_param($stmt, "ii", $tempHP, $characterid);
mysqli_stmt_execute($stmt);
// echo "Remove foreign key to signature-attack-2";
}
if (!empty($tempHP)):{
echo $tempHP;
} else: {
echo "--";
} endif;
} endif;
?>