note 35200 deleted from function.header by sniper
| From: | sniper@php.net | Date: | Sun, 07 Sep 2003 21:52:58 +0000 |
| Subject: | note 35200 deleted from function.header by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55664@lists.php.net to get a copy of this message | ||
Note Submitter: ng4rrjanbiah@rediffmail.com
----
If you're looking for a logic to code Web bug
(http://www.netlingo.com/lookup.cfm?term=Web%20bug) or invisible counter, here it is. See, the usage
of Content-type header in this context.
<?php
//File name: webbug.php
//Usage: <IMG src="webbug.php?id=999">
if (isset($_GET['id'])) //if "id" is passed, process it
{
//set cookies (if necessary)
//log the user, browser, and other details
//Important: Do not print or echo any messages here
}
//show 1x1 invisible GIF...
header("Content-type: image/gif");
echo chr(0x47).chr(0x49).chr(0x46).chr(0x38).chr(0x39).
chr(0x61).chr(0x01).chr(0x00).chr(0x01).chr(0x00).
chr(0x80).chr(0x00).chr(0x00).chr(0x04).chr(0x02).
chr(0x04).chr(0x00).chr(0x00).chr(0x00).chr(0x21).
chr(0xF9).chr(0x04).chr(0x01).chr(0x00).chr(0x00).
chr(0x00).chr(0x00).chr(0x2C).chr(0x00).chr(0x00).
chr(0x00).chr(0x00).chr(0x01).chr(0x00).chr(0x01).
chr(0x00).chr(0x00).chr(0x02).chr(0x02).chr(0x44).
chr(0x01).chr(0x00).chr(0x3B);
?>
HTH,
R. Rajesh Jeba Anbiah