PHP simulation Server to achieve AutoIndex effect _php Tutorial

Source: Internet
Author: User

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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.