Well, I'm sure this is an age-old problem, but I haven't been able to find a fix. I'm sure it's something embarrasingly obvious, but alas, I am posting here. My difficulties are, once again, with that fun-loving header(); function. However, I'm sure that nothing html is sent before my headers. My file is:
<?php
ob_start();
$data_file="list.txt"; //a simple array in a file of stuff
/do some stuff. Nothing interesting
/
$photo=$image_dir.trim($data[$num]);
$size = getimagesize($photo);
if($size[2]==1){
header("Content-type: image/gif"); //
$im=imagecreatefromgif($image_dir.$photo);
ImageGif($im);
ImageDestroy($im);
}
if($size[2]==2){ header("Content-type: image/jpeg");
/ and so on, untill the end of the file, when I do a /
ob_end_flush();
?>
I keep getting parse errors in the line with the first header, even if the image is not a gif, which bothers me. I tried to keep my code sample as readable as possible, but if you want to see it, the source is http://rhionna.dyndns.org/casey/?action=show_source