php文件管理器
发布时间:2023-02-20 10:34:49 所属栏目:PHP 来源:互联网
导读:代码: html head title文件管理/title Meta charset=utf-8 / /head body ?PHP //定义要查看的目录 $dir=/; //先判断$_GET[a]是否已经传值 防止NOTICE错误 if(isset($_GET[a])){ //选择判断要执行的操作 switch($_GET[a]){ case creat: //新建文件 $filename
continue; } //拼路径 $file=rtrim($dir,"/")."/".$f; //防止中文乱码 $f2=iconv("gb2312","utf-8",$f); echo "<tr>"; echo "<td>{$f2}</td>"; echo "<td>".filetype($file)."</td>"; echo "<td>".filesize($file)."</td>"; echo "<td>".filectime($file)."</td>"; echo "<td align='center'> <a href='index.PHP?a=edit&filename={$file}'>修改</a>| <a href='index.PHP?a=del&filename={$file}'>删除</a> </td>"; echo "</tr>"; } ?> </table> <?PHP if(isset($_GET['a']) && $_GET['a']=='edit'){ echo "<hr/>"; echo "<form action='index.PHP?a=update' method='post'>"; echo "文件名:<input type='text' name='filename' readonly value='{$_GET['filename']}' />"; echo "<br/><br/>"; echo "<textarea name='content' rows='5' cols='30'>".file_get_contents($_GET['filename'])."</textarea>"; echo "<br/><br/>"; echo "<input type='submit' value='保存修改' />"; echo "</form>"; (编辑:莱芜站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |