<?phprequire_once 'dir.func.php';require_once 'file.func.php';require_once 'common.func.php';$path="file";$act=$_REQUEST['act'];//就是這兒一直有問(wèn)題$filename=$_REQUEST['filename'];//就是這兒一直有問(wèn)題$info=readDirectory($path);//調(diào)用dir.func.php中的函數(shù)讀取文件//print_r($info);//查看$info中的內(nèi)容?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無(wú)標(biāo)題文檔</title><link rel="stylesheet" href="cikonss.css" /><script src="jquery-ui/js/jquery-1.10.2.js"></script><script src="jquery-ui/js/jquery-ui-1.10.4.custom.js"></script><script src="jquery-ui/js/jquery-ui-1.10.4.custom.min.js"></script><link rel="stylesheet" href="jquery-ui/css/ui-lightness/jquery-ui-1.10.4.custom.css" ?type="text/css"/><style type="text/css"> body,p,div,ul,ol,table,dl,dd,dt{ margin:0; padding: 0; } a{ text-decoration: none; } ul,li{ list-style: none; float: left; } #top{ width:100%; height:48px; margin:0 auto; background: #E2E2E2; } #navi a{ display: block; width:48px; height: 48px; } #main{ margin:0 auto; border:2px solid #ABCDEF; } .small{ width:25px; height:25px; border:0;}</style><script type="text/javascript"> function show(dis){ document.getElementById(dis).style.display="block"; } function delFile(filename,path){ if(window.confirm("您確定要?jiǎng)h除嘛?刪除之后無(wú)法恢復(fù)喲!!!")){ location.href="index.php?act=delFile&filename="+filename+"&path="+path; } } function delFolder(dirname,path){ if(window.confirm("您確定要?jiǎng)h除嘛?刪除之后無(wú)法恢復(fù)喲!!!")){ location.href="index.php?act=delFolder&dirname="+dirname+"&path="+path; } } function showDetail(t,filename){ $("#showImg").attr("src",filename); $("#showDetail").dialog({ ?height:"auto", ? ? ?width: "auto", ? ? ?position: {my: "center", at: "center", ?collision:"fit"}, ? ? ?modal:false,//是否模式對(duì)話框 ? ? ?draggable:true,//是否允許拖拽 ? ? ?resizable:true,//是否允許拖動(dòng) ? ? ?title:t,//對(duì)話框標(biāo)題 ? ? ?show:"slide", ? ? ?hide:"explode" }); } function goBack($back){ location.href="index.php?path="+$back; }</script></head><body><div id="showDetail" ?style="display:none"><img src="" id="showImg" alt=""/></div><h1>慕課網(wǎng)-在線文件管理器</h1><div id="top"> <ul id="navi"> <li><a href="index_1.php" title="主目錄"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-home"></span></span></a></li> <li><a href="#" ?onclick="show('createFile')" title="新建文件" ><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-file"></span></span></a></li> <li><a href="#" ?onclick="show('createFolder')" title="新建文件夾"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-folder"></span></span></a></li> <li><a href="#" onclick="show('uploadFile')"title="上傳文件"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-upload"></span></span></a></li> <?php? $back=($path=="file")?"file":dirname($path); ?> <li><a href="#" title="返回上級(jí)目錄" onclick="goBack('<?php echo $back;?>')"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-arrowLeft"></span></span></a></li> </ul></div><form action="index_1.php" method="post" enctype="multipart/form-data"><table width="100%" border="1" cellpadding="5" cellspacing="0" bgcolor="#ABCDEF" align="center"><tr id="createFolder" ?style="display:none;"> <td>請(qǐng)輸入文件夾名稱</td> <td >? ? ? ? ? ? <input type="text" name="dirname" /> <input type="hidden" name="path" ?value="<?php echo $path;?>"/> <input type="submit" ?name="act" ?value="創(chuàng)建文件夾"/>? ? ? ? ?? </td></tr> <tr id="createFile" ?style="display:none;"> <td>請(qǐng)輸入文件名稱</td> <td > <input type="text" name="filename" /> <input type="hidden" name="path" value="<?php echo $path;?>"/> <input type="hidden" name="act" value="createFile" />? ? ? ? ? ? ? ? <input type="submit" value="創(chuàng)建文件"> </td> </tr> <tr id="uploadFile" style="display:none;"> <td >請(qǐng)選擇要上傳的文件</td> <td ><input type="file" name="myFile" /> <input type="submit" name="act" value="上傳文件" /> </td> </tr></table><table width=%100 border="1" cellpadding="5" cellspacing="0" bgcolor="#ABCDEF" align="center"><tr><td>編號(hào)</td><td>名稱</td><td>類型</td><td>大小</td><td>可讀</td><td>可寫</td><td>可執(zhí)行</td><td>創(chuàng)建時(shí)間</td><td>修改時(shí)間</td><td>訪問(wèn)時(shí)間</td><td>操作</td></tr><?php//遍歷文件if($info['file']){ $i=1; foreach($info['file'] as $val){?><tr>? ? <td><?php echo $i;?></td>? ? <td><?php echo $val;?></td>? ? <td><?php echo filetype($path."/".$val);?></td>? ? <td><?php echo transByte(filesize($path."/".$val))?></td>? ? <td><?php echo is_readable($path."/".$val);?></td>? ? <td><?php echo is_writable($path."/".$val);?></td>? ? <td><?php echo is_executable($path."/".$val);?></td>? ? <td><?php echo date("Y-m-d H:i:s",filectime($path."/".$val));?></td>? ? <td><?php echo date("Y-m-d H:i:s",filemtime($path."/".$val));?></td>? ? <td><?php echo date("Y-m-d H:i:s",fileatime($path."/".$val));?></td>? ? <td>? ? ? ? <a href="index_1.php?act=showContent&path=<?php echo $path;?>&filename=<?php echo $path."/".$val;?>" ><img class="small" src="images/show.png" ?alt="" title="查看"/></a>| <a href="index_1.php?act=editContent&path=<?php echo $path;?>&filename=<?php echo $path."/".$val;?>"><img class="small" src="images/edit.png" ?alt="" title="修改"/></a>| <a href="index_1.php?act=renameFile&path=<?php echo $path;?>&filename=<?php echo $path."/".$val;?>"><img class="small" src="images/rename.png" ?alt="" title="重命名"/></a>| <a href="index_1.php?act=copyFile&path=<?php echo $path;?>&filename=<?php echo $path."/".$val;?>"><img class="small" src="images/copy.png" ?alt="" title="復(fù)制"/></a>| <a href="index_1.php?act=cutFile&path=<?php echo $path;?>&filename=<?php echo $pv;?>"><img class="small" src="images/cut.png" ?alt="" title="剪切"/></a>| <a href="#" ?onclick="delFile('<?php echo $p;?>','<?php echo $path;?>')"><img class="small" src="images/delete.png" ?alt="" title="刪除"/></a>| <a href="index_1.php?act=downFile&path=<?php echo $path;?>&filename=<?php echo $path."/".$val;?>"><img class="small" ?src="images/download.png" ?alt="" title="下載"/></a> </td></tr><?php$i++;? }?}?></table></body></html>
為什么我總是出現(xiàn)未定義的索引,請(qǐng)各位幫忙看看前面的加粗加黑的語(yǔ)句
陽(yáng)光細(xì)雨0
2017-06-08 11:20:20