Created
April 10, 2018 15:58
-
-
Save sukhmeet2390/590eeb95babe6dcd27935fe385875d03 to your computer and use it in GitHub Desktop.
List all the files of a folder index.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$path = "."; | |
$dh = opendir($path); | |
$i=1; | |
while (($file = readdir($dh)) !== false) { | |
if($file != "." && $file != ".." && $file != "index.php" && $file != ".htaccess" && $file != "error_log" && $file != "cgi-bin") { | |
echo "<a href='$path/$file'>$file</a><br /><br />"; | |
$i++; | |
} | |
} | |
closedir($dh); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment