Hi, I'm trying to make a table with an array of filenames I get from a folder on my webserver with opendir()
I already got it so far that the files show in an alphabetical order, but now I want it to show in a horizontal and vertical loop in an html table. Now all the data shows in one line underneath eachother. I want a horizontal line and after that it has to jump to the next line.
Now my code is this:
<?php
if ($dir = @opendir('images/cars/' . $_GET['car_folder'] . ''))
{
while (($file = readdir($dir)) !== false)
{
if($file != ".." && $file != ".")
{
$filelist[] = $file;
}
}
closedir($dir);
}
?>
<?php
asort($filelist);
while (list ($key, $val) = each ($filelist)) {
echo "<table width=\"100px\" class=\"tekst2\"><tr><td>";
echo "<a href=\"images/cars/";
echo $_GET['car_folder'];
echo "/$val\"><img src=\"images/cars/";
echo $_GET['car_folder'];
echo "/$val\" width=\"100\" height=\"75\" border=\"0\"></a></td></tr></table>";
} ?>
Can someone help me with this, I tried a couple of scripts but it's not always the right way. I'm not so good at coding so...