I want to upload an image to the folder /images and keep its name
This is what i got:
html
<form action="script.php" method="post" enctype="multipart/form-data">
<input type="file" name="mynewimage">
<input type="submit">
</form>
php
if (!empty($_FILES['mynewimage']['name'])) {
move_uploaded_file($_FILES['mynewimage']['tmp_name'], "images/" . $_FILES["mynewimage"]["name"]);
}
/images folder is 777
error says: UPLOAD_ERR_NO_FILE
Value: 4; No file was uploaded.