|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
现在,也有了从事软件工程的想法,在经过了一个月的PHP培训学习之后,发现其实软件工程并没有想像中的那么难。
上面的只是一些晋级法式、
/*list.php3*/
<?
session_start();
require("func.php3");
connect();
if (strstr($tpath,".."))
{echo "不要试图损坏我的站点";exit;}
If ($user=='')
{Header("Location: login.php3");}
echo "<head><title>====================================主页空间办理体系2.3====================================</title></head>
<center><a href=sm.html target=_blank>主页空间办理体系2.3匡助</a>
――――<a href="javascript:ShowWin('xgxxxx.php3')">修正用户团体材料</a>――――<a href=logout.php3>加入上岸</a></div></center><br>";
echo "你好{$user}。";
if ($bf<>"")
{
$date=date(Y).date(m).date(d);
$backupcommand="e:hubomysqlbinmysqldump --opt -u $user -p{$pass} {$user} >e:homepage\{$user}\{$user}数据库备份.日期{$date}";
//echo $backupcommand;
exec($backupcommand) ;
echo "<font color=red>数据库导出胜利!</font><br>导出文件为:你的主页根目次下:{$user}数据库导出.日期{$date}";
}
$dbs = mysql_list_dbs();
$dbcount=mysql_numrows($dbs);
$flag=0;
for ($i=0;$i<$dbcount;$i++)
{
if ($user==mysql_dbname($dbs, $i))
{$flag=1;break;}
}
if ($flag==0)
{
$dbuser=$user;
$dbpassword=$pass;
session_register("dbuser");
session_register("dbpassword");
echo "您还没有创立本人的数据库。请点击创立数据库按钮,请不要关失落弹出窗口<input type=button value=创立本人的mysql数据库 onclick=window.open("createdb.php3","","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=50,height=50,top=40,left=30"); class=no>";
}
else
{echo "<center><form method=post action=list.php3 >您的数据库已可使用,数据库名为{$user},暗码为上岸暗码,数据库主机为202.106.104.41";
echo "<input type=hidden name=bf value=true><br><input type=submit value=数据库导出 class=no>
<input type=button value=数据库导入 class=no onclick=window.open("import.php3","newwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=270,height=50");>
</form></center>";
}
?>
<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>
<style>
td{font-size:9pt}
body{font-size:9pt}
input { background-color: #FFFFFF; border: 1px #000000 dashed}
.no { background-color: #D4D0C8}
.no1 { background-color: #E6F3F7; border-style: none}
.no2 { background-color: #eeeeee; border-style: none}
</style>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
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;
if (is_dir($$del))
{rmdir("{$$del}");}
if (is_file($$del))
{unlink($$del);}
echo "<font color=red>{$$del}被删除</font><br>";
}
}
}
while ($file = readdir($handle))
{
if (is_dir($file)){$dirlist[]=$file;}
if (is_file($file)){$filelist[]=$file;}
}
closedir($handle);
?>
<body bgcolor="#D0D2E3">
<form action=list.php3 method=post ENCTYPE="multipart/form-data" name=form1>
<input type=hidden name=remark value="">
<table width="0%" cellspacing="0" cellpadding="0" align="center">
<tr bgcolor="#0066FF">
<td bgcolor="#3366FF">
<div align="center"><font color="#FFFFFF"><b>文件上传</b></font></div>
</td>
<td bgcolor="#D0D2E3"> </td>
<td bgcolor="#3366FF">
<div align="center"><font color="#FFFFFF"><b>创立目次</b></font></div>
</td>
</tr>
<tr>
<td>
<input type=file name=file1>
<input type=button value=上传 name="button1" id="button1" class=no>
</td>
<td bgcolor="#D0D2E3" rowspan="2"> </td>
<td rowspan="2" valign="top">
<input type="text" name="dir">
<input type="button" name="button2" id="button2" value="创立" class=no>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="unzip" value="true" style="background-color:#D0D2E3;border-style: none">
主动解压zip文件(包含途径) </td>
</tr>
</table>
<input type=hidden name=stoppath value=<?echo $path;?>>
</form>
<form method="post" action="list.php3" name=form2>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div align="left">
<input type=hidden name="remark" value="del">
<input type=hidden name=stoppath value=<?echo $path;?>>
<input type="button" name="del" value="删除" class=no>
</div>
</td>
<td> </td>
</tr>
</table>
<table width="100%" border="1" cellspacing="1" cellpadding="3" bordercolor="#666666">
<tr bgcolor="#CCCCCC">
<td width="1%" nowrap>
<div align="center">选定</div>
</td>
<td width="25%" nowrap>
<div align="center">文件名</div>
</td>
<td nowrap>
<div align="center">更名</div>
</td>
<td width="21%" nowrap>
<div align="center">文件类型</div>
</td>
<td width="21%" nowrap>
<div align="center">文件尺寸</div>
</td>
<td width="32%" nowrap>
<div align="center">最初修正日期</div>
</td>
</tr>
<?
$count=0;
if ($dirlist)
{
asort($dirlist);
for ($i=0;$i<count($dirlist);$i++)
{
$count++;
$filename=$dirlist[$i];
if ($filename=="abcdefghijk")
{
$sqls="update upfile_user set ph=ph+1,ptime=now() where username='$user'";
@mysql_query($sqls);
echo "<center><Font color=red>不要试图损坏我的硬盘。你的上岸已有效了,你的行动或许是有意的,可是你的行动已被纪录在案。
<br>注重,不要到你的目次以上,假如损坏次数超越了10次你的账号将被作废。</font></center>";
$user="";
session_register("user");
exit;}
if ($filename<>".")
{
if ($filename=="..")
{
if ($path=="/homepage/{$user}")
{$tfilename="根目次";$rename=" ";}
else
{$filename="上一级目次";$tfilename="<a href=list.php3?tpath=/>{$filename}</a>";$rename=" ";}
}
else
{$tfilename="<a href=list.php3?tpath=/$filename>{$filename}</a>";$rename="<a href=javascript:ShowWin2("rename.php3?name={$filename}&lx=dir")>更名</a>";}
$filetype="目次";
$filesize="无";
$lasttime=date("Y年m月d日H:i:s",filectime($dirlist[$i]));
echo "<tr bgcolor="#E6F3F7">
<td width=1%>
<div align=center>
<input type=checkbox name=checkbox{$count} class=no1>
<input type=hidden name=del{$count} value={$filename}>
</div>
</td>
<td width=25%>
<div align=center>{$tfilename}</div>
</td>
<td nowrap>
<div align=center>$rename</div>
</td>
<td width=21%>
<div align=center>{$filetype}</div>
</td>
<td width=21%>
<div align=center>{$filesize}</div>
</td>
<td width=32%>
<div align=center>{$lasttime}</div>
</td>
</tr>
";
}
}
}
if ($filelist)
{
$splitpath=explode("/",$path);
for ($i=3;$i<count($splitpath);$i++)
{
$temp=$temp."/{$splitpath[$i]}";
}
asort($filelist);
for ($i=0;$i<count($filelist);$i++)
{
$count++;
$filename=$filelist[$i];
$tfilename="<a href="http://202.106.104.41/zy/$user$temp/{$filename}" target=_blank>{$filename}</a>";
$filetype=strtolower(substr(($filelist[$i]),-4));
if ($filetype==".txt")
{$filetype="文本文件";
$editname="――<a href=javascript:ShowWin("edit.php3?path=$temp&file={$filename}")>手工编纂</a>";
}
else if ($filetype=="html" || $filetype==".htm")
{$filetype="超文本文件";
$editname="――<a href=javascript:ShowWin("edit.php3?path=$temp&file={$filename}")>手工编纂</a>";
}
else if ($filetype==".jpg" || $filetype==".gif")
{$filetype="图象文件";
$editname="";}
else if ($filetype==".zip" || $filetype==".rar")
{$filetype="紧缩文件";$editname="";}
else if ($filetype==".swf" || $filetype==".fla")
{$filetype="Flash文件";$editname="";}
else if ($filetype==".php" || $filetype==".php3")
{$filetype="PHP文件";
$tfilename=$tfilename."――<a href=javascript:ShowWin("edit.php3?path=$temp&file=$filename")>手工编纂</a>";
}
else if ($filetype==".CSS")
{$filetype="款式表文件";
$editname="――<a href=javascript:ShowWin("edit.php3?path=$temp&file=$filename")>手工编纂</a>";
}
else if ($filetype==".exe" || $filetype==".com")
{$filetype="可履行文件";$editname="";}
else
{$filetype="未知类型";$editname="";}
$filesize=filesize($filelist[$i]);
$lasttime=date("Y年m月d日H:i:s",filectime($filelist[$i]));
echo "<tr bgcolor="#eeeeee">
<td width=1%>
<div align=center>
<input type=checkbox name=checkbox{$count} class=no2>
<input type=hidden name=del{$count} value={$filename}>
</div>
</td>
<td width=25%>
<div align=center>{$tfilename}{$editname}</div>
</td>
<td nowrap>
<div align=center><a href=javascript:ShowWin2("rename.php3?name={$filename}&lx=file")>更名</a></div>
</td>
<td width=21%>
<div align=center>{$filetype}</div>
</td>
<td width=21%>
<div align=center>{$filesize}B</div>
</td>
<td width=32%>
<div align=center>{$lasttime}</div>
</td>
</tr>
";
}
}
?>
<input type=hidden name=count value=<?echo $count;?>>
<tr bgcolor="#CCCCCC">
<td width="1%" nowrap>
<div align="center">选定</div>
</td>
<td width="25%" nowrap>
<div align="center">文件名</div>
</td>
<td nowrap>
<div align="center">更名</div>
</td>
<td width="21%" nowrap>
<div align="center">文件类型</div>
</td>
<td width="21%" nowrap bgcolor="#CCCCCC">
<div align="center">文件尺寸</div>
</td>
<td width="32%" nowrap>
<div align="center">最初修正日期</div>
</td>
</tr>
</table>
</form>
<?
if ($gg=="")
{
$gg="ok";
session_register("gg");
require("gg.html");
}
?>
在相册系统的开发上,因为采用的是团队分工合作方式,更让我明白了在一个团队之中,团队成员之间的交流沟通的重要性,如果没有很好的沟通交流,成员之间的任务没有分配好。 |
|