file - Problems with $_FILES in PHP -
i trying make site 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 edit.php
-file have chosen use example w3schools (http://www.w3schools.com/php/php_file_upload.asp). when editor-page won't upload because file invalid type (filetype not found in array).
after many different tries putted code @ top of file:
if (!isset($_files['file'])) { die("not found!"); }
when loaded editor page again got error-message had put there myself. seems file sending index.php
-page won't founded in edit.php
.
can me?
it should , in edit.php file can try print $_files array.
//edit.php print '<pre>'; print_r($_files); // index.php <html> <body> <form action="edit.php" method="post" enctype="multipart/form-data"> <label for="file">filename:</label> <input type="file" name="file" id="file"><br> <input type="submit" name="submit" value="submit"> </form> </body> </html>
Comments
Post a Comment