//如果有文件上传就开始干活 if (isset ($_FILES['myfile'])){ //检查上传文件是否符合$allowedtypes类型 if (in_array($_FILES['myfile']['type'],$allowedtypes)){ if ($_FILES['myfile']['error'] == 0){ $thefile = "$savefolder/".$_FILES['myfile']['name']; //通过move_uploaded_file上传文件 if (!move_uploaded_file($_FILES['myfile']['tmp_name'], $thefile)){ echo "There was an error uploading the file."; } else{ ?> br />"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">