多文件上载系统完整版_php基础_脚本之家

<?php //多文件上载系统全部版 //效能强盛,可大肆调整上载文件数,是不是覆盖
include(“../include/common.inc”卡塔尔; $title = “多少个公文的上载程序”;
include(“../include/header.inc”卡塔尔国; //定义允许上载文件的数据
define(“UPLOAD_NO”, 10); echo(“<p align=’center’><font size=’4′
color=’#000080’>迎接您!<br>二遍能够最多上载”.UPLOAD_NO.”个文件<br><HR>n”);
if($REQUEST_METHOD!=”POST”){ echo(“<form enctype=”multipart/form-data”
method=post>n”); echo(“<INPUT TYPE=”hidden” name=”MAX_FILE_SIZE”
value=”3000000″>n”); for($i=1;$i<=UPLOAD_NO;$i++){ echo(“<input
type=file name=infile$i>”); if echo; } echo(“<br><br><input
type=”checkbox” name=”overload” value=”ON”></font> <font
color=’#ff0000’>是还是不是覆盖已经存在的文本?</font>”卡塔尔(قطر‎;
echo(“<br><br><input type=submit value=上载></form>n”卡塔尔(قطر‎; } else{
//管理上载 $noinput = true; for($i=1;$noinput&&{
if(${“infile”.$i}!=”none”) $noinput = false; } if{ echo(“<font size=’4′
color=’#000080’>没有选定的公文,重临重试</font>”卡塔尔; exit(卡塔尔国; }
echo(“<p align=’center’><font size=’4′
color=’#000080’>您当选的文书已经成功地上载到服务器的一时半刻目录!</font><br>”卡塔尔(قطر‎;echo(“<table
border=’1′ width=’84%’ height=’52’ bordercolorlight=’#008080′
bordercolordark=’#008080’> <tr> <td width=’14%’ bgcolor=’#008000′
height=’21’><font color=’#FFFFFF’>文件号</font></td> <td
width=’52%’ bgcolor=’#008000′ height=’21’><font
color=’#FFFFFF’>文件名称</font></td> <td width=’34%’
bgcolor=’#008000′ height=’21’><font
color=’#FFFFFF’>文件大小</font></td> </tr>”卡塔尔;
for($i=1;$i<=UPLOAD_NO;$i++){ $just=${“infile”.$i.”_size”};
$fp_size[i] = $just; if{
if(file_exists(AddSlashes(dirname.”upload”.${“infile”.$i.”_name”}))
echo “<font size=’4′ color=’#ff0000’>您上载的公文<font
color=’#000000’>”.${“infile”.$i.”_name”}.”</font>已经存在,该公文拷贝战败!</font><br>”;
else{
if(${“infile”.$i}!=”none”&©(${“infile”.$i},AddSlashes(dirname.”/upload/”.${“infile”.$i.”_name”})&&unlink(${“infile”.$i})){
$str = ${“infile”.$i.”_name”}; echo(“<tr> <td width=’14%’
height=’19’>$i</td> <td width=’52%’ height=’19’>$str</td> <td
width=’34%’ height=’19’>$fp_size[i]</td> </tr>”); } } } else{
if(${“infile”.$i}!=”none”&©(${“infile”.$i},AddSlashes(dirname.”upload”.${“infile”.$i.”_name”})&&unlink(${“infile”.$i})){
$str = ${“infile”.$i.”_name”}; echo(“<tr> <td width=’14%’
height=’19’>$i</td> <td width=’52%’ height=’19’>$str</td> <td
width=’34%’ height=’19’>$fp_size[i]</td> </tr>”); } } } echo
“</table>”;} include(“../include/footer.inc”); ?>

发表评论

电子邮件地址不会被公开。 必填项已用*标注