Can some tell me why this is coming out all messed up.
$x = 0;
print "<table width='100%' valign='top' align='center'>";
if ($handle = opendir("/www/htdocs/motelcs/admin/" . $project . "/siteimages")) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$t="<a href=\"/admin/" . $project . "/siteimages/$file\" target='blank'><img src=\"/admin/" . $project . "/siteimages/$file\" border=\"0\" width=\"100\" height=\"100\"></a>";
$dir_display[$x] = $t.substr($space,0,40-strlen($file));
}
$x++;
}
for($x = 0; $x < count($value); $x++){
asort($dir_display);
foreach($dir_display as $value){
if(($x%4)==1) print "<tr valign='top'>";
print "<td valign='top'>
<table border='0' width='100' cellspacing='0' cellpadding='0'>
<tr>
<td height='36' width='100'><div align='center'>$value</div></td>
</tr>
</table></td>";
if(!(++$x%4)) print "</tr>";
}
if(($x%4)==1) print "<td></td></tr>";
elseif(($x%4)==4) print "</tr>";
}
closedir($handle);
print "</table>";