php-db | 2002122

Re: [PHP-DB] SHOW PICTURE FROM DATABASE From: nikos (nikos <email protected>)
Date: 12/31/02

Steve

a. its a typo of mine in the e-mail
b. the "_type" is the type of the binary data. From the PHP manual read: "$userfile_type - The mime type of the file if the browser provided this information. An example would be "image/gif"
c. I'll try the file size

Thank you anyway

  ----- Original Message -----
  From: Steve Cayford
  To: Nikos Gatsis
  Cc: PHP-mailist
  Sent: Tuesday, December 31, 2002 1:07 AM
  Subject: Re: [PHP-DB] SHOW PICTURE FROM DATABASE

  Some suggestions...

  On Monday, December 30, 2002, at 03:55 PM, Nikos Gatsis wrote:
> where showpict.php:
>
> $query="SELECT pict FROM pict WHERE pro_id= '$pro_id";

  (You're missing an end ' there, but apparently that's not the problem)

> $result=mysql_db_query($database, $query, $conn) or Die
> (mysql_error());
> list($photo)=mysql_fetch_row($result);
> $type = $photo_type;

  Where did the $photo_type variable come from? What's in it?

> if (!empty($photo)) {
> header("Content-Type: {$type}");

  I believe this header should be in the form header("Content-Type:
  image/jpeg") or whatever image type you have.

  You should probably include an additional header
  header("Content-Length: " . strlen($photo));

> echo $photo;
> }
>
> THANX
> Nikos

  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php