Expand|Select|Wrap|Line Numbers
- <?php
- // Define the full path to your folder, shouldn't need changing
- $path = "./";
- // Open the folder
- $dir_handle = @opendir($path) or die("Unable to open folder");
- //create table
- echo '<table border=1 cellspacing=1 cellpadding=2 width=150%>';
- // Loop through the files
- while (false !== ($file = readdir($dir_handle))) {
- // Prevent this file itself being shown
- // If you want it to not display any other files
- // enter more of these
- if($file == "index.php")
- continue;
- //Prevent folders showing
- if($file == ".")
- continue;
- if($file == "..")
- continue;
- if($file == "bannerfinal.swf")
- continue;
- if($file == "display2.php")
- continue;
- if($file == "mu.jpg")
- continue;
- if($file == "LP_site.jpg")
- continue;
- if($file == "sabi.jpg")
- continue;
- if($file == "frenster.jpg")
- continue;
- if($file == "eriksite.jpg")
- continue;
- if($file == "bg2.jpg")
- continue;
- if($file == "bg3.jpg")
- continue;
- if($file == "md.jpg")
- continue;
- if($file == "gall.jpg")
- continue;
- // Display the results
- //echo '<tr>';
- echo '<td>' . "<a href='$file' target=_blank><img src='$file' alt='$file' width='220' height='220'></a>" . '</td>';
- //echo '</tr>';
- }
- echo '</table>';
- // Close it
- closedir($dir_handle);
- ?>