OK, that get me headed in the right direction. I also remember reading from other topics that I need to use the output buffers to get the pages to display properly, but the image is not displaying.
Right now the page loads but when it tries to load the image, IE just sits there and says "Downloading imge..." The icon in the upper right of the window keeps spinning as if it is still loading something. Here is the code I have now:
$im = 'somepic.jpg';
echo "<img src=\"serveImage.php?im=$im\" border=0>";
serveImage.php looks like this:
<?php
session_start();
ob_start();
if (!isset($_GET['im']))
die ('no type passed.');
else $im = escapeshellcmd(basename($_GET['im']));
$path = $_SESSION['images_root'].'/'.$im;
$dims = getimagesize ($path);
$imtypes = array('GIF', 'JPG', 'PNG', 'SWF', 'PSD', 'BMP', 'TIF', 'TIF', 'JPC', 'JP2', 'JPX', 'JB2', 'SWC', 'IFF', 'WBMP', 'XBM');
$ext = $imtypes[$dims[2]-1];
header('Content-Type: image/'.$ext);
if (!$h = fopen ($path, 'r'))
echo 'File open failed!';
else
{
fpassthru($h);
fclose($h);
}
ob_end_flush();
?>