Add file upload

This commit is contained in:
2024-04-25 10:19:24 +02:00
parent eb3086cb12
commit 2f49e6aa8a
5 changed files with 34 additions and 22 deletions

View File

@@ -1,12 +1,12 @@
<?php
function addMeme(string $memeText, int $imageID): bool
function addMeme(string $title, string $memeText, int $imageID): bool
{
global $mysqli;
if (isLoggedIn() && fileExists($imageID)) {
$stmtMemeAdd = $mysqli->prepare('INSERT INTO Memes (AuthorID, Title, TextContent, FileID) VALUES (?, ?, ?, ?)');
$stmtMemeAdd->bind_param('issi', $_SESSION['ID'], htmlspecialchars($memeText), $imageID);
$stmtMemeAdd->bind_param('issi', $_SESSION['ID'], htmlspecialchars($title), htmlspecialchars($memeText), $imageID);
$stmtMemeAdd->execute();
return true;
}