I am trying to make a site where I can upload pictures.
<form action="edit.php" method="get" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" value="submit">
</form>
In the edit.php
-file I have chosen to use the example from W3Schools (http://www.w3schools.com/php/php_file_upload.asp). When I get to the editor-page it won't upload because the file is a invalid type (filetype not found in the array).
After many different tries I putted this code at the top of the file:
if (!isset($_FILES['file'])) { die("Not found!"); }
When I loaded the editor page again I got the error-message I had put there myself. It seems like the file I am sending from the index.php
-page won't be founded in edit.php
.
Can anyone help me?