There is many errors in your PHP statement thats in the body of your page which I will explain below. Try somthing like this:
<?php
for( $i = 0; $i < 4; $i++)
{
echo "<td align='center'><img src='" . $pictures[$i] . "' width='100' height='100' alt='" . $i . "'></td>";
}
?>
Your errors were here:
- Your if statment will only display 3 photos while there is 4 in your array. You can either change the number to test for to 4, or change your tester to less than or equal to .... <=.
- You commented out the part that places the picture filename into the image tag. (the // makes PHP ignore it.)
-You put the value of $i in the src part of your image tag.
- You did not close the third echo after the tag
- Your PHP closing tag is backwards. Should be ?>
GliderPilot
Junior Poster in Training
86 posts since Sep 2006
Reputation Points: 8
Solved Threads: 4