<table width = 100% border=1>
<tr>
<?php
if( $HTTP_GET_VARS["path"] == "" )
{
$path = "c:\\Windows";
}
else
{
$path = stripslashes( $HTTP_GET_VARS["path"] );
}
$temp = getdate();
echo "[" . $temp["year"] . "年" . $temp["mon"] . "月" . $temp["mday"] . "日]<br>";
echo "<i><b>" . $path . "</b></i>";
$myDirectory = opendir( $path );
$count = 0;
while( $entryName = readdir( $myDirectory ) )
{
print( "<td>" );
if( $entryName == "." )
{
echo "<a href=\"index.php?path=" . $path . "\">" . $entryName . "</a>";
}
else if( $entryName == ".." )
{
$tempArray = strrpos( $path, '\\' );
echo "<a href=\"index.php?path=" . substr( $path, 0, $tempArray ) . "\">" . $entryName . "</a>";
}
else
{
if( !is_dir( $path . "\\" .$entryName ) )
{
echo $entryName;
}
else
{
echo "<a href=\"index.php?path=" . $path . "\\" . $entryName . "\">" . $entryName . "</a>";
}
}
print( "</td>" );
$count++;
if( $count % 4 == 0 ) print( "</tr><tr>" );
}
while( $count % 4 != 0 )
{
print( "<td></td>" );
$count++;
}
?>
</tr>
</table>