Jump to content

Deplay only file types i set.....


napalm

Recommended Posts

Hey, need some quick help...  a simple, that cant be done would be nice but i would like if i could get some help on this..

 

 

The script im working with:

<?
    $path = "./uploads/";

    $dir_handle = @opendir($path) or mkdir("./uploads/);

    while ($file = readdir($dir_handle)) {

    if($file == "." || $file == ".." || $file == "index.php" )

        continue;
        echo "$file";
    }
    closedir($dir_handle);

?>

 

displays files in the directory that i put.. but is there,

any way that i can have it so i can set where it only displays, file types like gif, jpg, etc...

 

 

so if in the directory theres html, swf, etc in the directory it does not show them...

just the files i set...

 

thanks!

Link to comment
https://forums.phpfreaks.com/topic/136897-deplay-only-file-types-i-set/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.