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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -