【php开源代码栏目提醒】:网学会员为广大网友收集整理了,simple_upload.php,希望对大家有所帮助!
<html>
<head>
<title>文件上传</title>
</head>
<body>
<table>
<form enctype="multipart/form-data" name=myform method="post">
<tr><td>文件上传</td><td><input name="myfile" type="file"></td></tr>
<tr><td colspan="2"><input name="submit" value="上传" type="submit">
</form>
<?php
if(isset($submit)){
if($myfile != "none") {
$upload_dir = "C:\WINNT\Temp";
$up=copy($myfile,$upload_dir);
if($up==1) {
print("文件上传成功!");
}
else {
print ("文件上传失败.");
}
unlink ($myfile);
}
else {
print("你没有上传任何文件");
}
}
?>
</td></tr>
</table>
</body>
</html>