html - Upload image and save to my folder in php -
this question has answer here:
- php file upload failing 3 answers
i have been trying utilize move_uploaded_file function in php however, nothing working, want user able upload file, file saved folder (p), below code, great.
index.php:
<html> <head> <title>test</title> </head> <body bgcolor="black"> <font color="white"> <form action="upload.php" method="post"> <input type="file" name="file" id="file"> <input type="submit" value="submit"> </form>
upload.php:
<html> <head> <title>helo world</title> </head> <body bgcolor="black"> <font color="white"> <?php move_uploaded_file($_files["file"]["tmp_name"], 'p/file.jpg'); ?>
you did not put attributes <form action="upload.php" method="post" enctype="multipart/form-data">
please read pages https://www.w3schools.com/php/php_file_upload.asp
Comments
Post a Comment