Link to home
Start Free TrialLog in
Avatar of ttist25
ttist25

asked on

PHP to mimick DirectoryIndex

Hey there!

How can I modify this:

<?php
if ($handle = opendir('pics')) {
    echo "Directory handle: $handle\n";
    echo "Files:\n";

    // List all the files
    while (false !== ($file = readdir($handle))) {
        echo "$file\n";
    }

    closedir($handle);
}
?>

to display a list of links to files in the pics directory?

I'm trying to get the same functionality that DirectoryIndex *.* in a .htaccess file would provide but my host doesn't allow custom .htaccess files.

I'm also open to alternative methods that might be more elegant.  

TIA
ASKER CERTIFIED SOLUTION
Avatar of steelseth12
steelseth12
Flag of Cyprus image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ttist25
ttist25

ASKER

Schweet!

Nice job!  Thanks.