Home > Backend Development > PHP Tutorial > PHP file upload main code explanation_PHP tutorial

PHP file upload main code explanation_PHP tutorial

WBOY
Release: 2016-07-21 16:13:27
Original
909 people have browsed it

Copy code The code is as follows:

if($_FILES['myfile'][' name'] != '') {
if($_FILES['myfile']['error'] > 0) {
echo "Error status:" . $_FILES['myfile'][' error'];
} else {
move_uploaded_file($_FILES['myfile']['tmp_name'], "uploads/" . $FILES['myfile']['name']);
echo "<script>alert(Upload successful!);</script>";
}
} else{
echo "
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template