$dat="$_GET[gallery].dat"; $file=fopen($dat, 'r'); $contents = fread ($file, filesize ($dat)); fclose($file); $img=explode("|",$contents);
print "<table width=50% cellpadding=0 cellspacing=3 border=0>";
foreach($img as $image) {
if($image) print "<tr><td><a href=$image><img src=\"$image\" width=150 height=100></a></td></tr>";
}
print "</table>";
Tom Ray [Lists] wrote:
I'm having a bit of a formatting issue, and I was wondering if someone might have an idea on how to solve it. Basically what I have right now is a script that opens and reads the content of an image directory, each time the script is accessed it writes the contents out to a text file for me. I then open that text file and read it's contents, I want to be able to display thumbnail versions of the pictures, 3 per row and as many rows as needed. Unfortunetly, all I can do right now is 1 per row, this is where I need the help. Here's the code that displays images:
$dat="$_GET[gallery].dat"; $file=fopen($dat, 'r');
$contents = fread ($file, filesize ($dat));
fclose($file);
$img=explode("|",$contents); print "<table width=50% cellpadding=0 cellspacing=3 border=0>";
foreach($img as $image) {
if($image) print "<tr><td><a href=$image><img src=\"$image\" width=150 height=100></a></td></tr>";
}
print "</table>";
So how do I make this work so I can have three cells per table row and it actaully show the proper picture?
TIA
Tom
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php