jagguy Posted November 20, 2006 Share Posted November 20, 2006 q)I want to add a directory of filenames to a database. How do I get the filenames from a directory with user input so I can use them with php.From there I can goto another page with all filenames and other data to add for each new record(which is each filename and asscociated data). Link to comment https://forums.phpfreaks.com/topic/27818-add-directory/ Share on other sites More sharing options...
glenelkins Posted November 20, 2006 Share Posted November 20, 2006 Im not sure exactly what your asking, but here is simply how you get the filenames into an array:[code]$open_dir = opendir("dirname");$c=0;while ($file = readdir($open_dir)) { if ($file != "." && $file != "..") { $files_array[$c]['filename'] = $file; } $c++;}[/code] Link to comment https://forums.phpfreaks.com/topic/27818-add-directory/#findComment-127279 Share on other sites More sharing options...
jagguy Posted November 20, 2006 Author Share Posted November 20, 2006 Ok thanks, I should have looked in php manual .What about the user getting a popup box of all the directories to choose from and just selecting a dir from on their PC. Instead of having to type it in manually. Link to comment https://forums.phpfreaks.com/topic/27818-add-directory/#findComment-127301 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.