多文件上传的例子_php基础
时间:2021-07-01 10:21:17
帮助过:4人阅读
多文件上传的例子
//upload_html.php---------------------------------------------------------------------------------------------
上传文件
//-----------------------------------------------------------------------------------------------------------------------
//upload.php-------------------------------------------------------------------------------------------------------------
//upload_path:文件要上传到的目录路径
for($i=1;$i<8;$i++)
{
$upfile="upfile".strval($i);
if(chop($$indexname)!="" and chop($$upfile)!="")
{
$upfilename=($upfile."_name");
$filename=upload_path.$$upfilename;
$copyfile = copy($$upfile,$filename);
if (!$copyfile)
die("文件上传失败!");
$ls_file.=$$upfilename."\n";
$flag=1 ;
}
}
if($flag){
$ls_msg="文件\n".$ls_file."上传成功!";
}
else{
$ls_msg="无文件上传,请重新选择!";
}
echo "\n" ;
echo "\n" ;
echo "\n" ;
echo "\n" ;
echo $ls_msg."\n";
echo "\n" ;
echo "\n" ;
?>