The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled PHP Code
Posted by: php dir list | March 26, 2009 @ 12:04pm
PHP Code
[
Download
]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>SMN Jazz 2003</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php if ($handle = opendir('.')) { ?> <h3>Songs:</h3> <ul> <?php $banned = array(".", "..", "index.php", "error_log"); // List all the files while ( false !== ( $file = readdir($handle) ) ) { if( !in_array($file, $banned) ) echo "<li><a href=\"$file\" title=\"$file\">$file</a></li>"; } closedir($handle); } ?> </ul>
Syntax Highlighting
[
Open in new window
]
Author Comments
this will only list the files in the same folder the php doc is in
Rating
4.48 / 8
224 Votes
http://codebin.yi.org/265
page generated in 0.01 seconds