Re: Syntax Eyes

From: Date: Wed, 25 Jul 2001 15:42:24 +0000
Subject: Re: Syntax Eyes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-59562@lists.php.net to get a copy of this message
I have a row in sql that is binary data (a jpeg) I need to echo that data to a table on the web page in the form of the original jepg, when I echo it now, I just get the actual data stream. How can I fix this? ----- Original Message ----- From: "Mark Roedel" <MarkRoedel@letu.edu> To: "Clayton Dukes" <cdukes@cdukes.com>; "Php-General" <php-general@lists.php.net> Sent: Wednesday, July 25, 2001 9:58 AM Subject: RE: [PHP] Syntax Eyes > > -----Original Message----- > > From: Clayton Dukes [mailto:cdukes@cdukes.com] > > Sent: Tuesday, July 24, 2001 10:53 PM > > To: Matthew Loff; 'Php-General' > > Subject: Re: [PHP] Syntax Eyes > > > > > > Okay, I figured out the @header will actually reset the > > headers, but it still just prints the raw data to the > > screen instead of the actual image. How can I fix this? > > Errr...actually, no it won't. > > @header(), as opposed to header(), simply says "If you run into any > errors, don't bother telling me about them." The fact that, as you say, > the raw data gets printed instead of an image, should tell you that the > header isn't having any effect. > > The general rule is that you can't send headers once you've started > sending output to the browser. In this case, I'm wondering why you want > image data and html tags in the same file anyway...is that really what > you intended? (Remember, a web browser is basically going to be > expecting a single file in response to a single request...) > > > --- > Mark Roedel (roedelm@letu.edu) || "There cannot be a crisis next week. > Systems Programmer / WebMaster || My schedule is already full." > LeTourneau University || -- Henry Kissinger > > > > > echo "</TD><TD NOWRAP ALIGN=\"LEFT\" > > BGCOLOR=\"#C8CCC8\">"; > > if($db->f("bin_data")) > > { > > /* > > This doesn't help... > > @header ("Content-disposition: filename=".$filename); > > @header( "Content-type: image/jpeg" ); > > */ > > $db->p("bin_data"); > > > > > > } else { > > echo "No Picture Available"; > > > > > > -Clayton > > > > > > > > ----- Original Message ----- > > From: "Matthew Loff" <matt@willetts.com> > > To: "'Clayton Dukes'" <cdukes@cdukes.com>; > > "'Php-General'" > > <php-general@lists.php.net> > > Sent: Tuesday, July 24, 2001 11:20 PM > > Subject: RE: [PHP] Syntax Eyes > > > > > > > > > > Output control functions will let you buffer the output, and you can > > > decide to send a header instead of flushing the buffer to > > the client: > > > > > > http://www.php.net/manual/en/ref.outcontrol.php > > > > > > ob_start() & flush() should accomplish this all for you. > > > > > > > > > -----Original Message----- > > > From: Clayton Dukes [mailto:cdukes@cdukes.com] > > > Sent: Tuesday, July 24, 2001 11:14 PM > > > To: Php-General > > > Subject: Re: [PHP] Syntax Eyes > > > > > > > > > Nevermind, I got it... > > > > > > Now, how do you reset header information if you need to redclare the > > > header(); ???? > > > > > > ie: > > > Warning: Cannot add header information - headers already > > sent by (output > > > started at ...

« previous php.general (#59562) next »