html - Upload image and save to my folder in php -


this question has answer here:

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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -