How can i get this two scripts good together and working as i want ???
script 1 (getting ALL files in a certain dir)
<?php
include("templates/Header.php");
//begin code
echo "<div align=\"center\">";
echo "<table border=\"0\" cellspacing=\"1\" width=\"756\">";
$dir = "/home/virtual/site185/fst/var/www/html/b/images";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while ($file = readdir($dh)) {
$strFile = $dir."/".$file;
echo is_dir($strFile) ? ""<tr><td width="20\"><input type=\"checkbox\" name=\"$file\"></td><td width=\"722\">
filename: $file
</td></tr>";
}
closedir($dh);
}
}
//end code
include("templates/Footer.php");
?>
script2 (Getting all file names and converting it into rows)
$num_cols = 4; // number of wanted colums
$foo = "<table border=0 cellpadding=3 cellspacing=0><tr>";
for($i = 0; $i < count($pics); $i++){
$picsize = @getimagesize($pics[$i]);
$foo .= "<td valign=top><img src='".$pics[$i]."' border=0 ".$picsize[3]."></td>\n";
($i != 0 && is_int($i/$num_cols)) ? $foo .= "</tr>\n<tr>\n" : $foo .= "";
}
$foo .= "</tr></table>";
echo $foo;
The last one isn't good for converting it the way i want it that one works with arrays
Can i get it together and working ??