List files in dir
<?php
echo ‘<h1>Index of /adult/</h1>’;
echo ‘<ul>’;
echo ‘<li><a href=”/”> Parent Directory</a></li>’;
$dir = scandir(‘.’);
$files = count( $dir );
for ( $i = 0; $i < $files; $i++ )
{
if ( is_file($dir[$i]) && strlen( $dir[$i] ) <= 36 && ( strstr( strtolower( $dir[$i] ), ‘.htm’ ) || strstr( strtolower( $dir[$i] ), ‘.html’ ) || strstr( strtolower( $dir[$i] ), ‘.php’ ) ) )
echo “<li><a href=\”$dir[$i]\”>$dir[$i]</a></li><br>”;
if ( is_dir($dir[$i]) && $dir[$i] != “.” && $dir[$i] != “..” && $dir[$i] != “adult” )
echo “<li>FOLDER – !!!! <a href=\”$dir[$i]\”/>$dir[$i]/</a></li><br>”;
}
echo ‘</ul>’;
?>
No comments yet.
Leave a Reply
-
Recent
- Photolisting Logic In PHP
- IMP Javascripts Functions
- PHP And CURL
- Javascripts : get mouse position
- List Of good Site Name
- Multi Select Box to MySql DB Table
- php ini settings
- PHP – Make URLs clickable (And short down)
- List files in dir
- Tiny PHP Uploader
- Multi Select Box to MySql DB Table
- List files in dir
-
Links
-
Archives
- December 2007 (1)
- August 2007 (12)
-
Categories
-
RSS
Entries RSS
Comments RSS