Add file upload
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user