Re: Cookies In Images...
| From: | Bas van Rooijen | Date: | Wed, 02 Jan 2002 21:27:54 +0000 |
| Subject: | Re: Cookies In Images... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79258@lists.php.net to get a copy of this message | ||
On Wed, 2 Jan 2002 14:11:39 -0700, Matthew Walker wrote:
>Can anyone give me a pointer on where to go to find out how to send
>cookies through images, preferably in PHP?
To do this you will have to point the HREF in your IMG tag to a PHP script.
From that script you should do this:
- Pass the correct content-type header (default for PHP is text/html) for example:
<?
header("Content-Type: image/jpeg");
?>
- Set the cookie as usual
- Then send the contents of the image you would like to display, for example:
<?
readfile("test.jpg");
?>
bvr.