Commit 64319058 authored by Roman Grossi's avatar Roman Grossi 😏

Update reward script to version 1.70

parent 8a96c551
Pipeline #36 failed with stages
<?php
/* Скрипт выдачи награды за голосование на FairTop.in */
/* Version: 1.61 (15.05.2018) */
/* Version: 1.70 (04.11.2018) */
/* Конфигурация */
$conf = array(
......@@ -41,7 +41,7 @@ if (!$mysqli) {
);
exit(json_encode($return));
}
$player = mysqli_real_escape_string($mysqli, $_POST['player']);
$player = $mysqli->real_escape_string($_POST['player']);
if ($_POST['hash'] != md5(sha1($player.':'.$conf['secret_key']))) {
$return = array(
'type' => 'error',
......@@ -63,18 +63,19 @@ if ($conf['use_weight'] === true) {
else {
$money = $conf['money'];
}
mysqli_query($mysqli, "UPDATE `$table` SET `$row`=`$row`+'$money' WHERE `$urow`='$player';");
if (mysqli_error($mysqli)) {
if ($mysqli->query("UPDATE `$table` SET `$row`=`$row`+'$money' WHERE `$urow`='$player';")) {
$return = array(
'type' => 'success',
'text' => 'Updated'
);
}
else {
$return = array(
'type' => 'error',
'text' => mysqli_error($mysqli)
'text' => $mysqli->error
);
exit(json_encode($return));
}
$return = array(
'type' => 'success',
'text' => 'Updated'
);
exit(json_encode($return));
/* Конец выдачи награды */
?>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment