500000) { echo "Your file is too large. The limit is 500 kilobytes.
"; $ok=0; } //This is our limit file type condition if ($uploaded_type == "image/gif/jpg/jpeg/png") { echo "Your avatar must have an extension of one of the following: gif, jpg, jpeg, or png.
"; $ok=0; } //Here we check that $ok was not set to 0 by an error if ($ok==0) { echo "Sorry your file was not uploaded"; } //If everything is okay, we try to upload it else { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; } } ?>