Re: [PHP] Image Header Problems

2004-01-13 Thread Bob Eldred

- Original Message - 
 function showpix($picture_id)
 {
 $sql=SELECT ug.group_name, p.name from usenet_groups as ug,
 pictures as  p WHERE p.id='$picture_id' AND ug.id=p.group_id;
 $result=mysql_query($sql) or die(mysql_error());
 $row=mysql_fetch_array($result);
 $dirhash=get_storage_dir($row[name]);
 $picturedirectory=STORAGEDIR./.$row[group_name];
 $fullpicturename=$picturedirectory./.$dirhash./.$row[name];
 header(Content-Type: image/jpeg);
 header(Content-Length: .filesize($fullpicturename));
 header(Content-Disposition: inline; filename=.$row[name]);
 readfile($fullpicturename);
 exit;
 }

OK, an update.  The pictures are saveable as .jpg's in Opera, so it seems to
be localized to IE.  Is there maybe a different set of headers that should
be sent for Internet Explorer, or do I just have a bug in my browser to deal
with?

Bob

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



Re: [PHP] Image header problems--SOLVED!

2001-08-09 Thread Hugh Danaher

It worked!! but only after I removed the two blank lines above the ?php
start line too.  Thank you very much.
- Original Message -
From: Corin Rathbone [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 09, 2001 3:40 PM
Subject: RE: [PHP] Image header problems


 Remove the line:

 print jpeg formatbr;

 The error is because you have sent output to the browser before you are
 trying to send a header.


 -Original Message-
 From: Hugh Danaher [mailto:[EMAIL PROTECTED]]
 Sent: 09 August 2001 23:26
 To: Php-General
 Subject: [PHP] Image header problems


 I want to generate an image using the following code, and think it should
 have worked.  Unfortunately I get an error message saying the header info
 has already been sent, and the browser (IE5) doesn't print a picture just
 the
 characterset representing the picture.  I think I've got it right, but
 obviously, I don't.  Any help will be greatly appreciated.



   1.
   2.
   3.?php
   4.print jpeg formatbr;
   5.header(content-type: image/jpeg,replace);
   6.$image=imagecreate(200,200);
   7.$red=imagecolorallocate($image,255,0,0);
   8.$blue=imagecolorallocate($image,0,0,255);
   9.imagearc($image,99,99,180,180,0,360,$blue);
 10.imagefill($image,99,99,$blue);
 11.imagejpeg($image);

 ?
 html
 body

 img src=test.php alt=a php generated image
 /body
 /html



 what I get is the following:

 Warning: Cannot add header information - headers already sent by (output
 started at /www/ironorchid/stocks/test.php:3) in
 /www/ironorchid/stocks/test.php on line 5
 ÿØÿàJFIFÿþCREATOR: gd-jpeg v1.0 (using IJG JPEG v62), ...

 A printout of the jpeg file (I think) and a broken link icon.



 --
 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]



-- 
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]