diff --git a/lib/meme.php b/lib/meme.php index 93992bf..b513f31 100644 --- a/lib/meme.php +++ b/lib/meme.php @@ -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;