<?
############################################################
#This application is postcardware, meaning you can freely use any part of it,
#as long as you mail me the changes and write me a postcard from the country
#your in.
#
#I'm currently saving up to a new computer, and if you find this application usefull,
#and would like to encourage me to write further programs, a small donation would be greatly
#appreciated. $10 is recommended.
#
#My adress is:
#
#Sune Alexandersen
#Kongsskogen 62
#1370 Asker
#Norway
#
#IF YOU USE THIS PROGRAM, YOU REALLY DO NOT HAVE TO DO ANYTHING.. THE ABOVE THINGS ARE ONLY
#SUGGESTIONS!!
#BUT PLEASE EMAIL ME IF YOU FIND IT USEFULL OR IF YOU HAVE ANY SUGGESTIONS!!
#
#Newest version of this program can be found at www.suneworld.com/programs
#
#The bottom line is that this program is free to use for all.
#You may modify this code as much you want, as long as you
#mail me the updates, so I can impliment in my own app at will.
#
#Live long and prosper my friend.
#Kind regards, Sune Alexandersen, president@suneworld.com 7.4.2000
############################################################
#☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
#☆ ☆
#☆ 欢迎访问 http://harpoon.yeah.net ☆
#☆ ☆
#☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
############### Set up some variables and funcions
############### CHANGE THIS TO YOUR DESIRED ROOT DIRECTORY
$basedir = "/web05/suneworld/html";
############### Webexplorer version
$version = "RC 1.0";
############### Size for textarea
$textrows = "20";
$textcols = "100";
############### If $wdir (working directory) isn't specified, set it as a slash (/)
if(!$wdir) $wdir="/";
############### Variable for html ender
$html_ender = "</td></tr><tr><td colspan=\"2\"><hr></td></tr><tr><th colspan=\"2\" bgcolor=\"#4C4C99\"><font size=\"-1\" color=\"white\" face=\"arial, helvetica\">Written by Sune Alexandersen 2000</font></th></tr></table></body></html>";
############### Function for html header
function html_header(){
global $basedir;
global $wdir;
global $lastaction;
global $version
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3c.org/TR/REC-html40/loose.dtd\">";
echo "<HTML>";
echo "<HEAD>";
echo "<TITLE>WebExplorer $version</TITLE>";
echo "</HEAD>";
echo "<BODY bgcolor=\"#C0C0C0\" link=\"#4C4C99\" vlink=\"#4C4C99\" alink=\"#4C4C99\">";
echo "<table border=\"0\" align=\"center\" cellspacing=\"3\" cellpadding=\"3\" width=\"600\">";
echo "<tr>";
echo " <th colspan=\"2\" width=\"100%\" bgcolor=\"#4C4C99\">";
echo " <A HREF=\"$PHP_SELF?action=env&wdir=$wdir\"><img src=\"env.gif\" alt=\"Environment\" border=\"0\"></A>";
echo " <font size=\"6\" color=\"white\" face=\"arial, helvetica\">WebExplorer $version</font>  ";
echo " <A HREF=\"$PHP_SELF?action=help&wdir=$wdir\"><img src=\"help.gif\" alt=\"Help\" border=\"0\"></A>";
echo " </th>";
echo "</tr>";
echo "<tr>";
echo " <td width\"50%\" align=\"left\"><A HREF=\"$PHP_SELF?action=root\"><font size=\"4\" face=\"arial, helvetica\">Back to root</font></a></td>";
echo " <td width\"50%\" align=\"right\"><A HREF=\"$PHP_SELF?wdir=$wdir\" title=\"Refresh current dir\"><font size=\"4\" face=\"arial, helvetica\">$wdir</font><img src=\"explore.gif\" border=\"0\"></a></td>";
echo "</tr>";
echo "<tr>";
echo " <td colspan=\"2\"><hr></td>";
echo "</tr>";
echo "<tr>";
echo " <td colspan=\"2\"><b><font size=\"3\" color=\"#4C4C99\" face=\"arial, helvetica\">$lastaction</font></b></td>";
echo "<tr>";
echo "<td colspan=\"2\"><hr><td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan=\"2\">";
}
############ File size calculations
function display_size($file){
$file_size = filesize($file);
if($file_size >= 1073741824)
{
$file_size = round($file_size / 1073741824 * 100) / 100 . "g";
}
elseif($file_size >= 1048576)
{
$file_size = round($file_size / 1048576 * 100) / 100 . "m";
}
elseif($file_size >= 1024)
{
$file_size = round($file_size / 1024 * 100) / 100 . "k";
}
else{
$file_size = $file_size . "b";
}
return $file_size;
}
############ List the directory function
function displaydir()
{
global $basedir;
global $wdir;
############### Draw the head table
echo "<TABLE BORDER=\"0\" cellspacing=\"1\" cellpadding=\"1\" width=\"100%\">";
echo "<tr>";
echo "<th bgcolor=\"#4C4C99\"><font color=\"white\" face=\"arial, helvetica\">Type</font></th>";
echo "<th bgcolor=\"#4C4C99\"><font color=\"white\" face=\"arial, helvetica\">Name</font></th>";
echo "<th bgcolor=\"#4C4C99\"><font color=\"white\" face=\"arial, helvetica\">Size</font></th>";
echo "<th bgcolor=\"#4C4C99\"><font color=\"white\" face=\"arial, helvetica\">Modified</font></th>";
echo "<th bgcolor=\"#4C4C99\"><font color=\"white\" face=\"arial, helvetica\">Perm's</font></th>";
echo "<th bgcolor=\"#4C4C99\"><font color=\"white\" face=\"arial, helvetica\">Action</font></th>";
echo "</tr>";
################## Load Directory and Files into seperate arrays
chdir($basedir . $wdir);
$handle=opendir(".");
while ($file = readdir($handle))
{
if(is_dir($file)) $dirlist[] = $file;
if(is_file($file)) $filelist[] = $file;
}
closedir($handle);
############### Put the directories first
if($dirlist)
{
############### Sort alphabetically
asort($dirlist);
############### Walk through array
while (list ($key, $file) = each ($dirlist))
{
################## Skip the tiresome "."
if (!($file == "."))
{
$filename=$basedir.$wdir.$file;
$fileurl=rawurlencode($wdir.$file);
$lastchanged = filectime($filename);
$changeddate = date("d-m-Y H:i:s", $lastchanged);
echo "<TR>";
############### Put up the PARENT arrow
if($file == "..")
{
$downdir = dirname("$wdir");
echo "<TD align=\"center\" nobreak><A HREF=\"$PHP_SELF?action=chdr&file=$downdir\"><img src=\"parent.gif\" alt=\"Parent directory\" border=\"0\"></a></TD>\n";
echo "<TD></TD>\n";
echo "<TD align=\"right\" nobreak><font size =\"-1\" face=\"arial, helvetica\">" . display_size($filename) . "</font></TD>";
echo "<TD align=\"right\" nobreak><font size =\"-1\" face=\"arial, helvetica\">" . $changeddate . "</font></TD><TD align=\"right\">";
printf("%o", (fileperms($filename)) & 0777);
echo "</TD><TD nobreak>";
echo "<A HREF=\"$PHP_SELF?action=chdr&file=$downdir\"><img src=\"parent.gif\" alt=\"Parent directory\" border=\"0\"></A> ";
}
############### List the directory
else
{
$lastchanged = filectime($filename);
echo "<TD align=\"center\" nobreak><A HREF=\"$PHP_SELF?action=chdr&file=$fileurl\"><img src=\"folder.gif\" alt=\"Change working directory to $file\" border=\"0\"></a></TD>\n";
echo "<TD nobreak><font size =\"-1\" face=\"arial, helvetica\">" . htmlspecialchars($file) . "</font></TD>\n";
echo "<TD align=\"right\" nobreak><font size =\"-1\" face=\"arial, helvetica\">" . display_size($filename) . "</font></TD>";
没有合适的资源?快使用搜索试试~ 我知道了~
象FTP一样的文件管理器
共18个文件
gif:16个
php:1个
php3:1个
需积分: 50 63 下载量 128 浏览量
2001-04-18
00:00:00
上传
评论 3
收藏 25B ZIP 举报
温馨提示
文件管理器,就象FTP一样,可以创建目录,上传文件,删除文件,编辑文件,新建文件等等
资源推荐
资源详情
资源评论
收起资源包目录
987526133webexplorer.zip (18个子文件)
webexplorer
browse.gif 963B
help.gif 941B
move.gif 871B
index.php3 31KB
webpage.gif 977B
audio.gif 927B
parent.gif 79B
edit.gif 969B
security.gif 939B
WebExplorer.php 37KB
delete.gif 85B
touch.gif 921B
text.gif 895B
explore.gif 943B
image.gif 947B
env.gif 954B
folder.gif 899B
webscript.gif 977B
共 18 条
- 1
资源评论
普通网友
- 粉丝: 882
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功