diff --git a/admin/api.php b/admin/api.php index 8c10176..d213069 100644 --- a/admin/api.php +++ b/admin/api.php @@ -77,12 +77,14 @@ if (!empty($action) && $_SESSION["password"] == $config["admin_pwd"]){ if ($action == "setcontent" && !empty($_POST["id"]) && !empty($_POST["content"])){ $stmt6 = $mysqli->prepare("INSERT INTO Content (`ContentID`, `Type`, `Content`) VALUES (?, ?, ?);"); + $type = ""; if (!empty($_POST["type"])){ $decoded = base64_decode($_POST["content"]); - $stmt6->bind_param('sss', $_POST["id"], $_POST["type"], $decoded); + $type = $_POST["type"]; + $stmt6->bind_param('sss', $_POST["id"], $type, $decoded); } else{ - $stmt6->bind_param('sss', $_POST["id"], "", $_POST["content"]); + $stmt6->bind_param('sss', $_POST["id"], $type, $_POST["content"]); } $stmt6->execute(); $stmt6->store_result();