<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_34892"> 可以丢到后台 方便代码阅读什么的 <div class="blockcode"> <div id="code_NBU"><ol> <li> <?php <li>//文件浏览程序</li> <li>error_reporting(0);</li> <li>$pwd = empty($_GET['dir']) ? './' : $_GET['dir'];</li> <li>$pwd = realpath($pwd);</li> <li> <li>if(is_file($pwd)) { </li> <li> highlight_file ($pwd);</li> <li> exit;</li> <li>}else </li> <li> $it = new FilesystemIterator($pwd);</li> <li>?></li> <li> <li> <li> <title>pwd of <?php echo $pwd ?> </title> </li> <li> <li> <li> <h1>pwd of <?php echo $pwd ?> </h1> <hr> </li> <li> <pre><a href="?dir=<?php%20echo%20dirname(%24pwd)?>">../</a></pre> </li> <li> <?php <li>foreach ($it as $file){ </li> <li> if($file->isDir()) {</li> <li> $fileSize = '_';</li> <li> $fileName = $file->getFilename() . '/';</li> <li> } elseif($file->isFile()) {</li> <li> $fileSize = $file->getSize();</li> <li> $fileName = $file->getFilename();</li> <li> }</li> <li> $date = date('Y-m-d H:i',$file->getCTime());</li> <li>?><a href="?dir=<?php%20echo%20%24file->getRealPath()?>"><?php echo $fileName ?></a><?php echo str_pad($date, 60-strlen($fileName),' ',STR_PAD_LEFT)?><?php echo str_pad($fileSize,30,' ',STR_PAD_LEFT)?> </li> <li> <li> <?php }?><hr> </li> <li> <li> </ol></div> <em onclick="copycode($('code_NBU'));">复制代码</em> </div> <img src="/static/imghwm/default1.png" data-src="http://img.it-home.org/data/attachment/forum/2014pic/12103152_D6zd.jpg" class="lazy" alt="php 模拟服务器 autoindex 效果。 " > <img src="/static/imghwm/default1.png" data-src="http://img.it-home.org/data/attachment/forum/2014pic/12103152_LVmw.jpg" class="lazy" alt="php 模拟服务器 autoindex 效果。 " > </td></tr></table> <div id="comment_34892" class="cm"> </div> <div id="post_rate_div_34892"></div> <br><br>