Re: Inline Images ?
| From: | Miguel Cruz | Date: | Tue, 23 Jul 2002 05:47:06 +0000 |
| Subject: | Re: Inline Images ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109035@lists.php.net to get a copy of this message | ||
On Sun, 21 Jul 2002, Roberto Ramírez wrote:
> Is there a way to display an image withouth sending the headers first?
You have to send the header - that's how the browser knows what sort of
image it is.
> I'm trying to display an inline image... but when I try it just only
> send the raw image data...
>
> I've thinking that I need to save an image first to disk and then
> display the image later...
That's not necessary.
<?
if ($_GET['displayimage'] == 1)
{
header('Content-Type: image.gif');
// output image data
exit;
}
// rest of page goes here
echo "<p>Hi there. Here is an image:
<img src='{$_SERVER['PHP_SELF']}?displayimage=1'></p>";
?>
miguel