I've spent most of my day working on this image uploader, after browsing and visitng many many threads and forums I've found several solutions to my problems however I am now at the point where if I try a different solution, something else breaks.
What I've got so far:
<form action="create.php" method="post" enctype="multipart/form-data">
Select File
<input type="file" name="upload">
<input type="submit" name="submit" value="Upload" />
<input type="text" name="title" placeholder="Title" />
<input type="text" name="description" placeholder="Description" />
<input type="text" name="category" placeholder="Category" />
</form>
<?php
$conn = new PDO ("mysql:host=localhost;dbname=project;", "root", "0612733771Aa");
Full PHP is here, couldnt figure the formatting
The main error I'm getting is this:
if (isset($_POST["submit"]) && isset($_FILES['upload'])) {
$image_size = getimagesize($_FILES['upload']['tmp_name']);
if ($image_size === FALSE) {
die("Unable to determine image type of uploaded file");
}
Warning: getimagesize(): Filename cannot be empty in C:\Apache24\htdocs\create.php on line 29 Unable to determine image type of uploaded file
Any help would be much appreciated!