dspimage.inc
<?php

  include_once('database.egn');

  header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
  header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
  header('Cache-Control: no-cache, must-revalidate');
  header('Pragma: no-cache');

  if ( $prod_r = fetch_db_value('product_image', "WHERE product_id =
$product_id ") )
  {
  if ($prod_r['product_image'])
  {
   Header("Content-Type: {$prod_r['product_image_type']}");
   echo $prod_r['product_image'];
   exit();
  }
  }
 Header('Content-Type: image/gif');
  readfile("$DOCUMENT_ROOT/image/nopic.gif");
?>

index.php
<?php
    echo "
    <img src='include/dspimage.inc?product_id=123456'>
    ";
?>


--


Chris Lee
Mediawaveonline.com

em. [EMAIL PROTECTED]

ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120



""Boget, Chris"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is it possible to pull an image, stored as binary data in a
> mySQL table, and display it on a page inline?  So it acts
> as if the image was pulled from the file system normally?
>
> If it is possible, could you point me to some online resources
> that would give information on how this is done? I've tried
> a few things on my end to no avail.  I've also searched a
> few PHP sites (PHPBuilder, etc) but couldn't find anything
> there (I could be doing the wrong searches).
>
> In any case, any information would be most helpful!!
>
> thnx,
> Chris
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to