HTML
|
|
|
|
<?php
$path_sep = '/'; // Unix all the way, baby! $max_print_size = 255; // more than 255 chars is getting awefully long
$test_dir_path = "/home/bkosse/public_html/test"; $file_name = "test-description"; // description file name $testdir = dir( $test_dir_path );
print '<TABLE ALIGN="CENTER" CELLPADDING="2" CELLSPACING="0" BORDER="2" WIDTH="50%">' . "n";
while($entry=$testdir->read()) {
if( $entry == "." || $entry == ".." ) continue;
$testing = $test_dir_path . $path_sep . $entry;
if( !is_dir( $testing ) ) continue;
$description_file = @fopen( $testing . $path_sep . $file_name, "r" );
if( $description_file ){
$description = fread( $description_file, $max_print_size );
$description = trim( $description );
$description = str_replace( "n", "<BR>n", $description );
fclose( $description_file );
}
else {
$description = " (no description) ";
}
$display_entry = ucwords( strtr( $entry, "_", " " ) );
print "<TR>n";
print "<TD WIDTH="30%"><B><A HREF="$entry/">$display_entry";
print "</A></B> </TD>n";
print "<TD WIDTH="70%">$description</TD>n";
print "</TR>n";
} $testdir->close();
print "</TABLE>n";
?>
|
|
|
Usage Example
|
|
|
Rate This Script
|
|
|
|