managefile1.php

来自「仿榕树下文章系统春节版 1. 将makpass.php文件的root_pass修」· PHP 代码 · 共 147 行

PHP
147
字号
<?include ("admin_log.php");include ("xqfunc.php");/////////////////////上传数组文件/////////////////////////////////////////////if ($model=="upfile" and $act=="add")   {if($phpfile != "none") {       $phpfile_count=count($phpfile);       for ($i=0;$i<=$phpfile_count-1;$i++){         if( $phpfile_size[$i]!=0 )         $phpfile_s[]=$phpfile[$i];                                           }       $phpfile_count_s=count($phpfile_s);       if ($phpfile_count_s==0){        $msg="您还没有选择要上传的文件";        $turn_page="managefile.php";        error_0($msg,$turn_page);        exit;                              }       for ($i=0;$i<=$phpfile_count_s-1;$i++)   {        if( !$phpfile_size[$i] ) {        $msg="您上传的文件$phpfile_name[$i] 不存在或大小为零";        $turn_page="managefile.php";        error_0($msg,$turn_page);        exit;        }        if(file_exists("../images/upfile/$phpfile_name[$i]")) {        $msg="您上传的文件 $phpfile_name[$i] 已经存在,请改名";        $turn_page="managefile.php";        error_0($msg,$turn_page);        exit;        }        $full_filename[$i] = split("\.", $phpfile_name[$i]);        $file_extention[$i] = $full_filename[sizeof($phpfile_name[$i])];        if(!copy($phpfile[$i], "../images/upfile/$phpfile_name[$i]")) {            $msg="您上传的文件 $phpfile_name[$i] 失败,未知原因";        $turn_page="managefile.php";        error_0($msg,$turn_page);        exit;        }        if(!unlink("$phpfile[$i]")) {            $msg="您上传的文件 $phpfile_name[$i] 没有从临时文件中删除,请手动删除";        $turn_page="managefile.php";        error_0($msg,$turn_page);        exit;        }}       $msg="您成功上传了 $phpfile_count_s 文件";        $turn_page="managefile.php";        error_1($msg,$turn_page);        exit;}}//////////////////删除文件/////////////////////////////////////////////////////if ($model=="upfile" and $act=="del")   {if (!file_exists("../images/upfile/$file")) {    $msg="您要删除的图片不存在";        $turn_page="managefile.php";        error_0($msg,$turn_page);        exit;}if (is_file("../images/upfile/$file")) {        unlink("../images/upfile/$file");    $msg="您已经成功删除文件";        $turn_page="managefile.php";        error_1($msg,$turn_page);        exit;   }   }//////////////////重命名文件/////////////////////////////////////////////if ($model=="upfile" and $act=="rename")   {        echo "<html><head><STYLE><!--A:link {text-decoration:none}A:visited {text-decoration:none}A:hover {  text-decoration:underline;  color:brown;}p,br,body,td {color:black; font-size:9pt; line-height:140%;}--></STYLE></head><body BGCOLOR='EFEFEF'><br><br><br><br><br><br><br><br><br><br>";echo "<table width=\"60%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\" bgcolor=\"BBBBBB\" align=\"center\"><tr><td>";echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\"><tr bgcolor=\"#a6a7d9\"><td width=\"100%\" valign=\"middle\"><font color=\"#FFFFFF\">修改文件<font color=red>$file</font>名字</font></td></tr>";echo "<form action=\"managefile1.php\" method=\"post\">";echo "<tr bgcolor=\"#FFFFFF\">";echo "<td align=\"middle\"> &nbsp;";echo "<input type=\"text\"  name=\"newfile\" maxlength=\"10\" value=\"\" size=\"10\" style=\"background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4\" onMouseOver = \"this.style.backgroundColor = '#E5F0FF'\" onMouseOut = \"this.style.backgroundColor = ''\">";echo " <input type=\"submit\" value=\"提 交\" style=\"color: #000000; background-color: #EEEEF8; border-style: solid; border-width: 0\" onMouseOver =\"this.style.backgroundColor='#a6a7d9'\" onMouseOut =\"this.style.backgroundColor='EEEEF8'\" name=\"submit\">";echo "<input type=\"hidden\" name=\"act\" value=\"rename_act\">";echo "<input type=\"hidden\" name=\"file\" value=\"$file\">";echo "<input type=\"hidden\" name=\"p\" value=\"$p\">";echo "<input type=\"hidden\" name=\"model\" value=\"upfile\">";echo "</td></tr></form></table></td> </tr></table>";exit;}////////////////////////////////////////////////////////////////////////////if ($model=="upfile" and $act=="rename_act")   {if (!file_exists("../images/upfile/$file")) {    $msg="您要修改的图片不存在";        $turn_page="managefile.php";        error_0($msg,$turn_page);        exit;}if (is_file("../images/upfile/$file")) {        rename("../images/upfile/$file","../images/upfile/$newfile");    $msg="您已经成功修改文名字";        $turn_page="managefile.php";        error_1($msg,$turn_page);        exit;   }   }///////////////文件属性修改/////////////////////////////////////////////////if ($model=="upfile" and $act=="reatt")   {        echo "<html><head><STYLE><!--A:link {text-decoration:none}A:visited {text-decoration:none}A:hover {  text-decoration:underline;  color:brown;}p,br,body,td {color:black; font-size:9pt; line-height:140%;}--></STYLE></head><body BGCOLOR='EFEFEF'><br><br><br><br><br><br><br><br><br><br>";echo "<table width=\"60%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\" bgcolor=\"BBBBBB\" align=\"center\"><tr><td>";echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\"><tr bgcolor=\"#a6a7d9\"><td width=\"100%\" valign=\"middle\"><font color=\"#FFFFFF\">修改文件<font color=red>$file</font>属性</font></td></tr>";echo "<form action=\"managefile1.php\" method=\"post\">";echo "<tr bgcolor=\"#FFFFFF\">";echo "<td align=\"middle\"> &nbsp;";echo "<input type=\"text\"  name=\"newatt\" maxlength=\"10\" value=\"\" size=\"10\" style=\"background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4\" onMouseOver = \"this.style.backgroundColor = '#E5F0FF'\" onMouseOut = \"this.style.backgroundColor = ''\">";echo " <input type=\"submit\" value=\"提 交\" style=\"color: #000000; background-color: #EEEEF8; border-style: solid; border-width: 0\" onMouseOver =\"this.style.backgroundColor='#a6a7d9'\" onMouseOut =\"this.style.backgroundColor='EEEEF8'\" name=\"submit\">";echo "<input type=\"hidden\" name=\"act\" value=\"reatt_act\">";echo "<input type=\"hidden\" name=\"file\" value=\"$file\">";echo "<input type=\"hidden\" name=\"p\" value=\"$p\">";echo "<input type=\"hidden\" name=\"model\" value=\"upfile\">";echo "</td></tr></form></table></td> </tr></table>";exit;}/////////////////////////////////////////////////////////////////////////////if ($model=="upfile" and $act=="reatt_act")   {if (!file_exists("../images/upfile/$file")) {    $msg="您想修改的文件不存在";        $turn_page="managefile.php";        error_0($msg,$turn_page);        exit;}$newatt="0".$newatt;if (is_file("../images/upfile/$file")) {        chmod("../images/upfile/$file",$newatt);    $msg="您已经成功修改文件属性";        $turn_page="managefile.php";        error_1($msg,$turn_page);        exit;   }   }?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?