gif - Why does this PHP tracking pixel not working correctly? -
i'm working on setting simple pixel tracking script php, , below technically works, when @ inspector in safari following warning (1by1.gif 42b gif):
esource interpreted document transferred mime type image/gif.
header("content-type: image/gif"); header("content-length: 42"); echo file_get_contents("/path/to/1by1.gif"); // tracking stuff below here
i've looked @ other tracking pixels, , show in inspector if actual image, .php extension. ideas how fix warning?
edit:
i tried doing following , same warning:
header("content-type: image/gif"); $img = imagecreatefromstring(file_get_contents("/path/to/1by1.gif")); imagegif($img);
you write 1x1.gif
(or other made name) in html source , have apache serve php script. can .htaccess
along lines of:
rewriteengine on rewritecond %{request_filename} !-f rewriterule ^1x1\.gif$ tracking_script.php [nc,l]
this way safari sees gif
extension , won't complain.
Comments
Post a Comment