How to implement AutoIndex effect in PHP simulation server
This article mainly introduces the PHP simulation server to achieve the AutoIndex effect of the method, the example analysis of PHP operation URL and transfer parameters of the skills, with a certain reference value, the need for friends can refer to the next
In this paper, we describe the method of PHP simulation server to realize autoindex effect. Share to everyone for your reference. The implementation method is as follows:
The 1.PHP code is as follows:
The code is as follows:
File Browsing Program
error_reporting (0);
$pwd = Empty ($_get[' dir ')? './': $_get[' dir ';
$pwd = Realpath ($PWD);
if (Is_file ($pwd)) {
Highlight_file ($PWD);
Exit
}else
$it = new Filesystemiterator ($PWD);
?>
<title>PWD of <?php Echo $pwd?></title>
PWD of
"... /
foreach ($it as $file) {
if ($file->isdir ()) {
$fileSize = ' _ ';
$fileName = $file->getfilename (). '/';
} elseif ($file->isfile ()) {
$fileSize = $file->getsize ();
$fileName = $file->getfilename ();
}
$date = Date (' y-m-d h:i ', $file->getctime ());
? >getrealpath ()?> ">
2. Run the effect as shown:
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/966369.html www.bkjia.com true http://www.bkjia.com/PHPjc/966369.html techarticle How to implement AutoIndex effect in PHP simulation server This article mainly introduces the PHP simulation server to achieve the AutoIndex effect of the method, the example analysis of PHP operation URL and transfer parameters of the skills, with ...