Php > Code Snippets
List all files in a directory and place them in a select menu
List all files in a directory and place them in a select menu //list all files in current directory andplace //ina select box function listfiles() { echo '
'; $dir = opendir("./"); while($dirlist = readdir($dir)) { if ($dirlist[0] != "." && $dirlist[0] != ".." ) { echo "
$dirlist
"; } } echo '
'; closedir($dir); } echo '
'; listfiles(); echo '
'; ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage