melder/ajax/ajax_rating.php
Walter Hupfeld 34af6b6f75 fixes
2024-03-11 12:55:17 +01:00

20 lines
447 B
PHP

<?php
require_once("../config.php");
$mode = trim($_POST['mode']);
$id = (int)$_POST['id'];
$value = (int)$_POST['value'];
if ($mode=="up") {
$db->exec("UPDATE location SET thumb_ups=thumb_ups+1 WHERE id=".$id);
echo "success";
} elseif ($mode=="down") {
$db->exec("UPDATE location SET thumb_downs=thumb_ups+1 WHERE id=".$id);
echo "success";
} else {
echo "error";
};