帝国软件
  设为首页 加入收藏 关于我们
 
解密帝国网站管理系统
栏 目:
 
您的位置:首页 > 技术文档 > PHP编程
一套用于站点维护的页面程序(特别适用与linux下面)
作者:匿名 发布时间:2002-12-20 来源:www.code-labs.com
把这些文件放置于你的根目录下面的任意一个文件夹内!未加密!请读者自己加密!

文件清单:

chdir.php;delete.php;found.php;index.php;rename.php;show.php;upload.php;

由于upload.php中一些程序未完成,希望网友自己来完成;







------index.php----------

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>



<body>

<table width="775" border="0" align="center" cellpadding="0" cellspacing="00">

<tr>

<td> <form name="form1" method="post" action="found.php">

<div align="center"> <font size="2">建立文件夹部分:</font> <font size="2">

<input type="text" name="newname">

<input type="submit" name="Submit" value="建立文件夹">

</font></div>

</form></td>

</tr>

<tr>

<td height="117"><div align="center"><font size="2">文件列表部分:

<?



if($path=="")

{$path=".";}

else

{



$path=base64_decode($path);

}

$root=base64_decode(".");

$cope_path=base64_encode($path);

chdir("../");

chdir("$path");

$handle=@opendir(".");

echo "<br><a href=index.php?path=$root>回到根目录</a>";

?>

</font> </div>

<table width="75%" border="1" align="center" cellpadding="0" cellspacing="00" bordercolor="#FFFFFF" bordercolorlight="#000000">

<tr>

<td width="25%"><div align="center"><font size="2" face="Verdana">文档列表</font></div></td>

<td width="75%"><div align="center"><font size="2" face="Verdana">删除&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;改名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;进入</font></div></td>

</tr>

<?

while($file=readdir($handle))

{

if($file!="."&&$file!="..")

{if(is_dir($file))

{

?>

<tr>

<td height="30"><div align="left"><font size="2" face="Verdana"><a href="chdir.php?file=<? echo urlencode($file); ?>&path=<? echo $cope_path; ?>"><? echo $file;?></a></font></div></td>

<td height="30"><div align="center"><font size="2" face="Verdana"><a href="delete.php?file=<? echo urlencode($file); ?>&path=<? echo $cope_path; ?>">删除</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<a href="rename.php?file=<? echo urlencode($file) ; ?>&path=<? echo $cope_path; ?>">改名</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<a href="chdir.php?file=<? echo urlencode($file); ?>&path=<? echo $cope_path; ?>">

浏览</a></font></div></td>

</tr>

<?

}

else

{

?>

<tr>

<td height="30"><div align="left"><font size="2" face="Verdana"><a href="show.php?file=<? echo urlencode($file); ?>&path=<? echo $cope_path; ?>" target="_blank"><? echo $file;?></a></font></div></td>

<td height="30"><div align="center"><font size="2" face="Verdana"><a href="delete.php?file=<? echo urlencode($file) ; ?>&path=<? echo $cope_path; ?>">删除</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<a href="rename.php?file=<? echo urlencode($file); ?>&path=<? echo $cope_path; ?>">&nbsp;改名</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<a href="show.php?file=<? echo urlencode($file); ?>&path=<? echo $cope_path; ?>" target="_blank">&nbsp;浏览</a></font></div></td>

</tr>

<?

}

}



}?>

</table>

<form action="upload.php" method="post" enctype="multipart/form-data" name="form2">

<div align="center"><font size="2">上传文件部分:<br>

</font><font size="2" face="Verdana">

<input type="hidden" name="path" value="<? echo $path; ?>">

<input name="file1" type="file" size="15">

<input name="file2" type="file" size="15">

<br>

<input name="file3" type="file" size="15">

<input name="file4" type="file" size="15">

<br>

<input name="file5" type="file" size="15">

<input name="file6" type="file" size="15">

<br>

<input name="file7" type="file" size="15">

<input name="file8" type="file" size="15">

<br>

<input name="file9" type="file" size="15">

<input name="file10" type="file" size="15">

<br>

<input name="Submit2" type="submit" id="Submit2" value="上传">

<input type="reset" name="Submit3" value="重选">

</font> </div>

</form></td>

</tr>

</table>

</td>

</tr>

<tr>



<td height="156">&nbsp;</td>

</tr>

</table>

</body>

</html>









------------chdir.php--------------------









<?

if($path)

{

$path=base64_decode($path);

$file=urldecode($file);

$path.="/".$file;

$path=base64_encode($path);

echo "<meta http-equiv='refresh' content='0;URL=index.php?path=$path'>";

}

?>





---------------delete.php-----------------------







<?

if($path)

{

$path=base64_decode($path);

$file=urldecode($file);

chdir("../$path");

if(!is_dir($file))

{

unlink($file);

$path=base64_encode($path);

echo "<div align='center'><font color='RED'>成功删除文件!</font></div>";

echo "<meta http-equiv='refresh' content='0;URL=index.php?path=$path'>";

}

else

{

$info=rmdir($file);

if($info=="0")

{

$path=base64_encode($path);

$file=urlencode($file);

echo "<div align='center'><font color='RED'>您的文件夹非空!为了安全,请进入确认是否要删除这些文件!</font></div>";

echo "<meta http-equiv='refresh' content='2;URL=chdir.php?file=$file&path=$path'>";

}

else

{

echo "<div align='center'><font color='RED'>成功删除文件!</font></div>";

echo "<meta http-equiv='refresh' content='0;URL=index.php?path=$path'>";

}

}

}

?>











----------------------found.php---------------------







<?

if($path)

{

if($Submit)

{

if($newname)

{

$path=base64_decode($path);

$file=urldecode($file);

chdir("../$path");

mkdir($newname,777);

$path=base64_encode($path);

echo "<div align='center'><font color='RED'>成功建立文件夹!</font></div>";

echo "<meta http-equiv='refresh' content='0;URL=index.php?path=$path'>";

}

}}



?>









----------------------rename.php-------------------------











<?

if($path)

{

if($Submit)

{

if($newname)

{

$path=base64_decode($path);

$file=urldecode($file);

chdir("../$path");

rename($file,$newname);

$path=base64_encode($path);

echo "<div align='center'><font color='RED'>成功更改文件名!</font></div>";

echo "<meta http-equiv='refresh' content='1;URL=index.php?path=$path'>";

}

}

else

{?>

<form name="form1" method="post" action="<? echo $php_self;?>">

<div align="center">文件<? echo $file;?>改名为 :

<input name="newname" type="text" size="10">

<input type="submit" name="Submit" value="改名">

</div>

</form>

<?

}

}

?>









---------------show.php------------------------







<?



if($path)

{

$path=base64_decode($path);

$file=urldecode($file);

$path.="/".$file;//$path=base64_encode($path);

echo "<meta http-equiv='refresh' content='0;URL=../$path'>";

}





?>











-------------------------upload.php-----------------------

有待解决~~~~~只能上传一个文件!

代码重复,也可以实现!



<?

if($Submit2)

{

$path=base64_decode($path);

chdir("../$path");

// 下面的代码重复也可以实现多文件上传!将$file1顺次改成$file2,3,4...

if($file1="")

{

$newname=$file1_name;

@copy($file1,$newname);

}

//这里结束;

}

$path=base64_encode($path);

echo "您的文件上传成功!";

echo "<meta http-equiv='refresh' content='1;URL=index.php?path=$path'>";

}

?>

  
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关链接
 ·一套加解密字符串的函数  (2005-03-12)
 ·一套全新的计数器(session控制,  (2002-12-20)

   栏目导行
  PHP编程
  ASP编程
  ASP.NET编程
  JAVA编程
   站点最新
·致合作伙伴的欢迎信
·媒体报道
·帝国软件合作伙伴计划协议
·DiscuzX2.5会员整合通行证发布
·帝国CMS 7.0版本功能建议收集
·帝国网站管理系统2012年授权购买说
·PHPWind8.7会员整合通行证发布
·[官方插件]帝国CMS-访问统计插件
·[官方插件]帝国CMS-sitemap插件
·[官方插件]帝国CMS内容页评论AJAX分
   类别最新
·Windows下集成安装Apache,PHP,MYSQ
·Mysql注入:SQL Injection with MyS
·PHP 的来龙去脉
·PHP 的功能概述
·PHP与其它CGI的比较
·PHP 的编译配置详细选项
·php.ini 配置详细选项
·如何写作PHP程序
·Hello,World
·嵌入方法
 
关于帝国 | 广告服务 | 联系我们 | 程序开发 | 网站地图 | 留言板 帝国网站管理系统