forked from Adleraci/adlerka.top
MEME
This commit is contained in:
parent
afbeff1b08
commit
5cee6d3044
@ -6,19 +6,12 @@ function addMeme(string $title, string $memeText, int $imageID): array
|
||||
{
|
||||
global $mysqli;
|
||||
$output = ["Status" => "Fail"];
|
||||
echo isLoggedIn() ? "a" : "b";
|
||||
echo fileExists($imageID);
|
||||
echo !empty($title) ? "x" : "y";
|
||||
echo !empty($memeText) ? "a" : "b";
|
||||
echo !empty($imageID) ? "a" : "b";
|
||||
echo $imageID;
|
||||
if (isLoggedIn() && fileExists($imageID, false) && !empty($title) && !empty($memeText) && !empty($imageID) && $imageID > 0) {
|
||||
$stmtMemeAdd = $mysqli->prepare('INSERT INTO Memes (AuthorID, Title, TextContent, FileID) VALUES (?, ?, ?, ?)');
|
||||
$stmtMemeAdd->bind_param('issi', $_SESSION['ID'], htmlspecialchars($title), htmlspecialchars($memeText), $imageID);
|
||||
if($stmtMemeAdd->execute() && $stmtMemeAdd->affected_rows > 0) {
|
||||
$output["Status"] = "Success";
|
||||
$output["Meme"] = "Funny";
|
||||
$output["Error"] = $stmtMemeAdd->error;
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
|
Loading…
Reference in New Issue
Block a user