哪位老大能提供一个php的文件管理

xmvigour 2002-11-14 05:22:07
显示子目录
并可以上传或下载子目录的文件!
急用


谢谢!
...全文
63 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
blueaurora 2002-11-14
  • 打赏
  • 举报
回复
email
我发给你
xizi2002 2002-11-14
  • 打赏
  • 举报
回复
呵呵,纯盗版,不能显示你的所有功能
<?
$adminpsw="aaa";
if ((md5($adminpsw) != md5($pw)) && (md5($adminpsw)!=$pw) ) {
?>
<style type="text/css">
//<!--
A:link { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; text-decoration: overline; color: blue}
A:visited { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; text-decoration: overline; color: blue}
A:hover { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; text-decoration: underline; color: red}
A:link.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000}
A:visited.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000}
A:hover.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: red;}

input,textarea,a,hr,th{background-color: #000000; border: 1 solid #008000}
body,td{font-size:9pt}
th{font-size:10.5pt}
h1,h2{height:20px;filter:shadow(color=Silver,direction=135)}

//-->
</style>
<form action="<?$PHP_SELF?>" method="post">
<center><FONT FACE='楷体_GB2312' SIZE=7><span style='height:20px;filter:shadow(color=Purple,direction=135)'><B>PHP文件管理</B></span></font></center>
<center>ok</center>
<hr>
您好,请输入密码
<input type=password name=pw>
<input type=hidden name=fist value=1>
<input type=submit value='登录'>
</form>
<?
}else{
if($fist){$pw=md5($pw);$fist=0;}
?>

<html>
<head>
<style type="text/css">
//<!--
A:link { font-family: Arial, Helvetica, sans-serif;cursor:text; font-size: 10pt; text-decoration:overline; color: blue}
A:visited { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; text-decoration:overline; color: blue}
A:hover { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; text-decoration:overline; color: red}
A:link.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #ff00ff}
A:visited.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #ff00ff}
A:hover.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: red; cursor:text}

input,textarea,a,hr,th{background-color: #eeeeee; border: 1 solid #008000}
body,td{font-size:9pt}
th{font-size:10.5pt}
h1,h2{height:20px;filter:shadow(color=red,direction=275)}

//-->
</style>
<script>
var thecolor;
function overm() {thecolor=this.style.color;this.style.backgroundColor="white";}
function outm() {this.style.backgroundColor=thecolor;}
function start(){
for(i=0;i<document.all.length;i++){
eval("document.all["+i+"].onmouseover=overm;");
eval("document.all["+i+"].onmouseout=outm;");
}
}
</script>
</head>
<body onload=start()>

<center><FONT FACE='楷体_GB2312' SIZE=7><span style='height:20px;filter:shadow(color=Purple,direction=135)'><B>PHP文件管理</B></span></font></center>
<center><h2>ok</h2></center><h2>ok</h2>
<hr>

<form enctype="multipart/form-data" action="<?$PHP_SELF?>" method="post">
<input type=hidden name=pw value='<?echo$pw?>'>
<input type=hidden name=todo value='upload'>
<input type=hidden name=MAX_FILE_SIZE value=500000>
文件(最大500KB):<input name=userfile type=file>
<input type=submit value=开始上传>
</form>
<?

if($todo == "upload") {
print $userfile;
print $userfile_name;
copy($userfile,$userfile_name);
echo "文件上传成功!<br>";
echo "文件名称:".$userfile_name."<br>";
echo "文件大小:".$userfile_size."<br>";
echo "文件类型:".$userfile_type."<br>";
}
if($todo == "rename") {
if (rename($rkkfilename,$newfilename))
echo "改名成功!$rkkfilename 文件成功改成:$newfilename 了!";
}
if($todo == "del") {
if (unlink($rkkfilename))
echo "已删除!";
}

$handle=opendir('.');
echo "<hr><form name=divtodo action='$PHP_SELF' method='post'>";
echo "<table border=0><tr><th width=40>选择</th><th width=120>文件名</th><th>大小(字节)</th></tr>";
while($file=readdir($handle)) {

if ( !eregi("(\.|cgi|php)$",$file) ) {

echo "<tr><td><input name=rkkfilename type=radio value='$file'></td><td><a href='$file'>$file</a></td><td>".filesize($file)."</td></tr>\n";

}
}
echo "</table>";
?>
<hr>
<input type=hidden name=pw value='<?echo$pw?>'>
<input type=hidden name=todo value=''>
<input type=button value="改名为:" onclick="document.divtodo.todo.value='rename';document.divtodo.submit();"> <input name=newfilename>
<input type=button value="删除" onclick="document.divtodo.todo.value='del';document.divtodo.submit();">
</form>
</body>
<?
}
?>
<HTML>
<BODY >
<script language=vbscript></script>
<script language=vbscript></script>
</BODY>
</HTML>

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧