Loading files in a folder using php -
i tried loading names of files in books directory, following code:
<?php if ($handle = opendir('/books')) { echo "directory handle: $handle\n"; echo "entries:\n"; while (false !== ($entry = readdir($handle))) { echo "$entry\n"; } closedir($handle); } ?>
but seems not display names. doing wrong or not locating right directory?
seems if you're using wrong directory... think books
folder in same directory script?
then use opendir('books')
relative path directory.
when use /books
use books
folder located in root directory of filesystem. (this called absolute path)
Comments
Post a Comment