Jump to content

[SOLVED] readdir()


ambo

Recommended Posts

Hello Im trying to to make it so readdir doesnt display folders

 

<?

    $vProc = "../Process/";

    $dir_handle = @opendir($vProc) or die("Error opening $path");

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

    if($file == "." || $file == ".." || $file == "index.php" ) { continue; }

    echo "<a href=\"view.php?file=$file\">$file</a><br>";

    }

    // Close

    closedir($dir_handle);

?>

Link to comment
https://forums.phpfreaks.com/topic/146417-solved-readdir/
Share on other sites

<?
    $vProc = "../Process/";
    $dir_handle = @opendir($vProc) or die("Error opening $path");
    while ($file = readdir($dir_handle))
    {
        if($file != "." || $file != ".." || $file != "index.php" )
        {
            echo "<a href=\"view.php?file=$file\">$file</a><br>";
        }
    }
    // Close
    closedir($dir_handle);
?>

Link to comment
https://forums.phpfreaks.com/topic/146417-solved-readdir/#findComment-768713
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.