<script language="JavaScript">
function ShowWin(htmlurl){
var newwin=window.open(htmlurl,"newwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=350,height=500");
}
function ShowWin2(htmlurl){
var newwin=window.open(htmlurl,"newwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=250,height=50");
}
</script>
function button1_onclick()
{
form1.remark .value ="shangchuan";
form1.submit() ;
}
function button2_onclick()
{
form1.remark .value ="chuangjian";
form1.submit() ;
}
function del_onclick()
{
if (confirm("你确认要删除这些目次或文件吗?"))
{
form2.submit();
}
}
//-->
</SCRIPT>
<?
$df = diskfreespace("/");
$freespace=ceil($df/1024/1024);
echo "<br>磁盘残剩空间:{$freespace}M<BR>";
if ($tpath=="")
{ $path=$basepath; }
else if ($tpath=="/")
{
if ($basepath<>"/homepage/{$user}")
{
$splitpath=explode("/",$basepath);
for ($i=1;$i<count($splitpath)-1;$i++)
{$path=$path."/{$splitpath[$i]}";}
}
else
{$path="/homepage/$user";}
}
else
{ $path=$basepath.$tpath; }
if ($stoppath<>"")
{$path=$stoppath;}
if ($directpath<>"")
{$path=$directpath;}
//echo "path={$path}"."<br>";
//echo "basepath:$basepath<br>";
$basepath=$path;
if (!strstr($basepath,"/homepage/$user"))
{echo "你上他人的目次干甚么?";exit;}
session_register("basepath");
$splitpath=explode("/",$path);
$newpath="<a href="http://202.106.104.41/zy/{$user}" target=_blank>你的主页</a>";
for ($i=1;$i<count($splitpath);$i++)
{
$temppath=$temppath."/{$splitpath[$i]}";
if ($i==1)
{$newpath=$newpath;}
else if ($i==2)
{$newpath=$newpath."/<a href=list.php3?directpath=/homepage/$user>根目次</a>";}
else
{$newpath=$newpath."/<a href=list.php3?directpath={$temppath}>{$splitpath[$i]}</a>";}
}
echo $newpath."<br>";
if (!file_exists($path))
{mkdir($path,0000) or die("目次创立毛病,多是你的用户名里有不法的字符<br>请于<a href=mailto:qdlover@sina.com>站长</a>接洽");}
chdir($path);
$handle = opendir(".");
//上传文件
if ($remark=="shangchuan")
{
If($file1 != "none")
{
$filesize=ceil(filesize($file1)/1024);
if ($filesize==0)
{
$dx=filesize($file1)."byte";
}
else
{$dx=$filesize."K";}
copy($file1,"{$path}/{$file1_name}");
if ($unzip=="true")
{
$commandstring="echo a | e:/homepage/pkunzip -d e:{$path}/{$file1_name} e:{$path}/";
$commandstring=strtr($commandstring,"/","\");
system($commandstring) ;
$unzipok="解压胜利!";
$delcommand=strtr("del e:{$path}/{$file1_name}","/","");
system($delcommand);
}
unlink($file1);
$sqls="update upfile_user set dx=dx+{$filesize} where username='$user'";
@mysql_query($sqls);
echo "<font color=red>文件:".$file1_name."({$dx})";
if ($unzipok<>"")
{echo $unzipok;}
else
{ echo "上传胜利,可以持续上传</font>";}
}
}
//创立目次
if ($remark=="chuangjian")
{
if (!$dir)
{echo "<font color=red>创立目次不克不及为空!</font>";}
else
{
if (!file_exists($dir))
{
mkdir($dir,0000);
echo "<font color=red>目次{$dir}创立胜利</font>";
}
else
{
echo "<font color=red>目次{$dir}已存在</font>";
}
}
}
//删除文件和目次
if ($remark=="del")
{
for ($i=1;$i<=$count;$i++)
{
$check="checkbox".$i;
if ($$check=="on")
{
$del="del".$i;