I have a .php file that looks like this:
foreach($stmt->fetchAll() as $array)
{
echo '<div class="thumb" style="width: '.$array['thumb_width'].'px; height: '.$array['thumb_height'].'px;">
<p><a href="showfile.php?image_id='.$array['image_id'].'">
<img src="showthumbs.php?image_id='.$array['image_id'].'" alt="'.$array['image_name'].' /">
</a></p>
<p>'.$array['image_name'].'</p></div>';
}
I am following the tutorial here to basically upload and show images. When I view source the page that is loaded (which you can test out here), for some reason it’s not displaying the image. I have the showthumbs.php on the same location as the location of the gallery.php. What am I missing?
You probalby have a line break before your
<?phptag. That means something has already been output to the response body when you try to set the header. And Headers must be set before the Body is sent. Otherwise you get the error:Warning: Cannot modify header information – headers already sent
Just look for any chars before
<?phpin showthumbs.php. My guess is it’s a space or new line.