主题:新手上路,问题sos(文件上传)
请各位大虾看看小生的代码错在哪里了?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<form enctype="multipart/form_data" method="POST" action="unload.php" name="form1" onsubmit="unload.php">
<!--webbot bot="SaveResults"
U-File="D:\usr\www\html\_private\form_results.txt" S-Format="TEXT/CSV"
S-Label-Fields="TRUE" -->
<p><input type="file" name="t1" size="20">
<input type="submit" value="unload" name="B1"><input type="reset" value="全部重写" name="B2"></p>
</form>
<?
if(isset($B1))
{
if($t1!="none")
{
$v=opendir("\\temp);
if($v==0)
{mkdir("\\temp");
$v=opendir("\\temp");
}
$up=copy($t1,"\\temp\\$myfile_name");
if($up==1)
{echo "you are successful";}
else
{
echo "nothing you are put on";
}
unlink($t1);
closedir($v);
}
esle
{
echo "nothing you are put on" ;
}
}
?>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<form enctype="multipart/form_data" method="POST" action="unload.php" name="form1" onsubmit="unload.php">
<!--webbot bot="SaveResults"
U-File="D:\usr\www\html\_private\form_results.txt" S-Format="TEXT/CSV"
S-Label-Fields="TRUE" -->
<p><input type="file" name="t1" size="20">
<input type="submit" value="unload" name="B1"><input type="reset" value="全部重写" name="B2"></p>
</form>
<?
if(isset($B1))
{
if($t1!="none")
{
$v=opendir("\\temp);
if($v==0)
{mkdir("\\temp");
$v=opendir("\\temp");
}
$up=copy($t1,"\\temp\\$myfile_name");
if($up==1)
{echo "you are successful";}
else
{
echo "nothing you are put on";
}
unlink($t1);
closedir($v);
}
esle
{
echo "nothing you are put on" ;
}
}
?>
</body>
</html>