MEME
This commit is contained in:
parent
7da94c06d4
commit
f824b0c236
@ -6,7 +6,7 @@ function addMeme(string $title, string $memeText, int $imageID): array
|
|||||||
{
|
{
|
||||||
global $mysqli;
|
global $mysqli;
|
||||||
$output = ["Status" => "Fail"];
|
$output = ["Status" => "Fail"];
|
||||||
if (isLoggedIn() && fileExists($imageID)) {
|
if (isLoggedIn() && fileExists($imageID) && !empty($title) && !empty($memeText) && !empty($imageID) && $imageID > 0) {
|
||||||
$stmtMemeAdd = $mysqli->prepare('INSERT INTO Memes (AuthorID, Title, TextContent, FileID) VALUES (?, ?, ?, ?)');
|
$stmtMemeAdd = $mysqli->prepare('INSERT INTO Memes (AuthorID, Title, TextContent, FileID) VALUES (?, ?, ?, ?)');
|
||||||
$stmtMemeAdd->bind_param('issi', $_SESSION['ID'], htmlspecialchars($title), htmlspecialchars($memeText), $imageID);
|
$stmtMemeAdd->bind_param('issi', $_SESSION['ID'], htmlspecialchars($title), htmlspecialchars($memeText), $imageID);
|
||||||
$stmtMemeAdd->execute();
|
$stmtMemeAdd->execute();
|
||||||
|
Loading…
Reference in New Issue
Block a user