MEME
This commit is contained in:
parent
e7f177e4cc
commit
cf7368ba4f
13
lib/meme.php
13
lib/meme.php
@ -6,13 +6,12 @@ function addMeme(string $title, string $memeText, int $imageID): array
|
|||||||
{
|
{
|
||||||
global $mysqli;
|
global $mysqli;
|
||||||
$output = ["Status" => "Fail"];
|
$output = ["Status" => "Fail"];
|
||||||
echo "B";
|
echo isLoggedIn() ? "a" : "b";
|
||||||
echo isLoggedIn();
|
echo fileExists($imageID) ? "a" : "b";
|
||||||
echo fileExists($imageID);
|
echo !empty($title) ? "a" : "b";
|
||||||
echo !empty($title);
|
echo !empty($memeText) ? "a" : "b";
|
||||||
echo !empty($memeText);
|
echo !empty($imageID) ? "a" : "b";
|
||||||
echo !empty($imageID);
|
echo $imageID > 0 ? "a" : "b";
|
||||||
echo $imageID > 0;
|
|
||||||
if (isLoggedIn() && fileExists($imageID) && !empty($title) && !empty($memeText) && !empty($imageID) && $imageID > 0) {
|
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user