You can't display an image like that in HTML. You need to make a second PHP script that displays just the image, and call it with a <img> tag.
Kevin Waterson wrote:
>I am having some problems with ob_*
>
>My goals is basically this
>
><html>Stuff goes here
><?php header('Content-Type: image/jpeg'); echo file_get_contents('img.jpg';?>
>More stuff here</html>
>
>The code below works until the showImage method is called, it does show the image
>however, it does not output the 'Stuff goes here!' line.
>
>any guidance greatfully recieved.
>Code is below..
>
>Kevin
>
>
><?php
>class thumbs {
>
> function thumbs(){
>
> }
>
>
> function showThumbs(){
> return 'Thumbs';
> }
>
>
> function select(){
> if(isset($_GET['show']))
> {
> return $this->showImage($_GET['show']);
> }
> else
> {
> return $buffer.$this->showThumbs();
> }
> }
>
>
> function showImage(){
> $size = getimagesize ('./australia.jpg');
> if ($size)
> {
> header("Content-type: {$size['mime']}");
> return file_get_contents('australia.jpg');
> }
> else
> {
> return ' was not found on this server';
> }
> }
>} // end class
>
>$thumbs = new thumbs;
>
>ob_start(array($thumbs,'select'));
>
>?>
><html>
>Stuff goes here!
><?php
>ob_end_flush();
>?>
>
></html>
>
>
>
>
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php