
Originally Posted by
susanv
Thanks for replying John, but it is still not working... any other ideas? I don't know what else to try.

I think your problem was that you were still using your script and not calling the function read_dir()
Try this and once working delete or remark "echo jj,":
PHP Code:
#debug stuff - saves typing
define('jj', '<br />DEBUG: ');
define('jk', ' - ');
echo jj, __LINE__, jk, 'START';
echo jj, __LINE__, jk,
$dir = "documents/";
# make sure directory exists to prevent endless loop
if( is_dir( $dir ) )
{
echo jj, __LINE__, jk,
$dh = opendir($dir);
while (($file = readdir($dh)) !== false)
{
if( $file === '.' OR $file === '..')
{
# echo '<br />DO NOT ECHO: ' .$file;
}
else
{
echo '<br /><a href="documents/'.$file.'">'.$file.'</a>';
}
}
}
echo jj, __LINE__, jk, 'FINISH';
Bookmarks