Re: SV: [PHP] Problems with images..

From: Date: Mon, 03 Nov 2008 19:46:45 +0000
Subject: Re: SV: [PHP] Problems with images..
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-282821@lists.php.net to get a copy of this message
On Mon, 2008-11-03 at 15:56 +0100, Anders Norrbring wrote: > > Anders Norrbring wrote: > > > > > I've been staring myself blind, so now I don't get anywhere, please > > do > > > advice.. > > > > > > I have a web page printed with PHP, in a table I need to display > > > images that are stored in a SQL DB. > > > Getting the images into variables isn't an issue at all, but how do I > > > output it? > > > This is what I want to accomplish: > > > > > > <tr><td>Current image:</td><td> - THE IMAGE HERE - > > > </td></tr> > > > > > > Starting to pull my hair.. > > > Anders. > > > > <img src="fetchimg?id=<nnnnn>"/> > > > > fetchimg.php: > > > > header('Content-Type: image/jpeg'); > > $img=<fetch from db>; > > print $img; > > > True Per, but I would prefer one single file in this case.. > > Anders. > > You can have the image script as part of the same PHP file, by checking to see if it is being called for an image rather than a normal page, but it just makes things more convoluted. Also, the base64 method will not work in IE. I had a similar problem at work that could only be solved by using a separate script to output the image. It can't be streamed inline in a consistent manner. Ash www.ashleysheridan.co.uk

« previous php.general (#282821) next »