简单的文件上传程序
<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">
<? if(isset($submit))
{ if(
$myfile!="none")
{
$v=opendir("\temp");
if (
$v==0)
mkdir("\temp");
$v=opendir("\temp");
}
$up=copy($myfile,"\temp");
if(
$up==1)
{  print(
"文件上传成功!");}
else
{print (
"文件上传失败.");}
unlink ($myfile);
closedir ($v);}
else
{print(
"你没有上传任何文件");    }}
?>
</td></tr>
</table>
</body>
</html>