日期:2014-05-16 浏览次数:20418 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<?
if(@$_POST['action1'])
{
set_time_limit(60);
for($i=1;$i<3;$i++)
{
echo "<br>";
$file="file";
$file=$file.$i;
@$file_tmp=$_FILES["$file"]["tmp_name"];
if (empty($file_tmp)){
echo '临时目录为空';
exit();
}
@$file_name=$_FILES["$file"]["name"];
$path="up\\";
$ext=end(explode(".",$file_name));
$file_new_name=time().".".$ext;
$filea=$path.$file_new_name;
if(copy($file_tmp,$filea))
{
echo "successful";
echo "<br>";
echo "<img src='up/$file_new_name\'>";
}
else
{
echo "fail!!";
exit(1);
}
}
}
else
{
?>
<form action="" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="800000">
<input type="hidden" name="action1" value="1">
file1:<input type="file" name="file1" >
file2:<input type="file" name="file2">
<input type="submit" value="上传">
</form>
<?
}
?>
</body>
</html>