keep default value be integer

This commit is contained in:
xiaomlove
2021-01-06 01:39:45 +08:00
parent 9bce2ac1a4
commit 28ab56fe70
5 changed files with 31 additions and 31 deletions

View File

@@ -177,10 +177,10 @@ else {
elseif (isset($_POST['do']) && $_POST['do'] == "add")
sql_query ("INSERT INTO chronicle (userid,added, txt) VALUES ('".$CURUSER["id"]."', now(), ".sqlesc($txt).")") or sqlerr(__FILE__, __LINE__);
elseif (isset($_POST['do'] ) && $_POST['do'] == "update"){
$id = $_POST['id'] ?? 0;
$id = intval($_POST['id'] ?? 0);
if (!$id) { header("Location: log.php?action=chronicle"); die();}
else sql_query ("UPDATE chronicle SET txt=".sqlesc($txt)." WHERE id=".$id) or sqlerr(__FILE__, __LINE__);}
else {$id = ($_GET['id'] ?? 0);
else {$id = (intval($_GET['id'] ?? 0));
if (!$id) { header("Location: log.php?action=chronicle"); die();}
elseif ($_GET['do'] == "del")
sql_query ("DELETE FROM chronicle where id = '".$id."'") or sqlerr(__FILE__, __LINE__);
@@ -315,7 +315,7 @@ else {
break;
case "poll":
$do = $_GET["do"] ?? '';
$pollid = $_GET["pollid"] ?? 0;
$pollid = intval($_GET["pollid"] ?? 0);
$returnto = htmlspecialchars($_GET["returnto"] ?? '');
if ($do == "delete")
{