prepare("SELECT `LinkID`, `ContentID`, `Nickname` FROM Links"); $stmt1->bind_result($linkid, $contentid, $nickname); $stmt1->execute(); $stmt1->store_result(); $out = ""; while ($stmt1->fetch()) { $id = htmlspecialchars($linkid); $nickname = htmlspecialchars($nickname); $contentid = htmlspecialchars($contentid); $out = $out . ""; } $out = $out . ""; $out = $out . "
IDContent IDNicknameButton
$id$contentid$nickname
"; echo $out; } if ($action == "delete" && !empty($_POST["id"])){ $stmt2 = $mysqli->prepare("DELETE FROM Links WHERE `LinkID` = ?"); $stmt2->bind_param('s', $_POST["id"]); $stmt2->execute(); $stmt2->store_result(); } if ($action == "set" && !empty($_POST["id"]) && !empty($_POST["contentid"]) && !empty($_POST["nickname"])){ $stmt3 = $mysqli->prepare("INSERT INTO Links (`LinkID`, `ContentID`, `Nickname`) VALUES (?, ?, ?);"); $stmt3->bind_param('sss', $_POST["id"], $_POST["contentid"], $_POST["nickname"]); $stmt3->execute(); $stmt3->store_result(); } if ($action == "getcontent"){ $stmt4 = $mysqli->prepare("SELECT `ContentID`, `Content` FROM Content"); $stmt4->bind_result ($contentid, $content); $stmt4->execute(); $stmt4->store_result(); $out = ""; while ($stmt4->fetch()) { $id = htmlspecialchars($contentid); $content = htmlspecialchars($content); $out = $out . ""; } $out = $out . ""; $out = $out . "
Content IDContentButton
$id$content
"; echo $out; } if ($action == "deletecontent" && !empty($_POST["id"])){ $stmt5 = $mysqli->prepare("DELETE FROM Content WHERE `ContentID` = ?"); $stmt5->bind_param('s', $_POST["id"]); $stmt5->execute(); $stmt5->store_result(); } if ($action == "setcontent" && !empty($_POST["id"]) && !empty($_POST["content"])){ $stmt6 = $mysqli->prepare("INSERT INTO Content (`ContentID`, `Content`) VALUES (?, ?);"); $stmt6->bind_param('ss', $_POST["id"], $_POST["content"]); $stmt6->execute(); $stmt6->store_result(); } if ($action == "getlog"){ $idcko = $_POST["id"]; if (empty($idcko)||$idcko == "*"){ $query = "SELECT `ID`, `Action`, `LinkID`, `ContentID`, `Datetime`, `Timestamp`, `Nickname`, `IP` FROM Logs"; $stmt7 = $mysqli->prepare($query); } else{ $query = "SELECT `ID`, `Action`, `LinkID`, `ContentID`, `Datetime`, `Timestamp`, `Nickname`, `IP` FROM Logs WHERE `LinkID` = ?"; $stmt7->bind_param("s", $idcko); } $stmt7->bind_result ($rowidx, $actionx, $linkidx, $contentidx, $datetimex, $timestampx, $nicknamex, $ipx); $stmt7->execute(); $stmt7->store_result(); $out = ""; while ($stmt7->fetch()) { $action = htmlspecialchars($actionx); $link = htmlspecialchars($linkidx); $content = htmlspecialchars($contentidx); $nickname = htmlspecialchars($nicknamex); $ip = htmlspecialchars($ipx); $datetime = htmlspecialchars($datetimex); $out = $out . ""; } $out = $out . "
ActionDate and TimeNicknameLinkContentIP
$action$datetime$nickname$link$content$ip
"; echo $out; } } else{ echo "ERROR"; } ?>