Re: Images from database

From: Date: Tue, 10 Jul 2001 20:15:54 +0000
Subject: Re: Images from database
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-10226@lists.php.net to get a copy of this message
> "Randall Barber" <rdb55@email.byu.edu> wrote >I have seen in several places the following line: > > <img src='myScript.php' etc..etc..> > > Will this tag work in both IE and Netscape? Yes > What does myScript.php do? Does it find an image and pass the binary data back? Sure, that's one use; another is to dynamically generate an image. > Something like this-- > > <?php > $fp = fopen(odbc_result($qryResult, "imgPath"), "rb"); > fpassthru($fp); > fclose($fp); > ?> Yes; but you should send a header first, telling the browser what kind of image it's getting (ie 'Content-type: image/png' or whatever's appropriate).

« previous php.db (#10226) next »