Forum Moderators: coopster
At the moment, the image script (
c.php) goes like this:
/* caching headers */
header('Content-Type: image/gif');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
/* content length header */
header('Content-Length: '.filesize('trans.gif'));
readfile('trans.gif');
/* db stuff to log pageview and referrer */
trans.gifis a 1x1 transparent gif. At the moment, when I view the page with firefox, the status bar shows 'Transferring data from [domain.com]', and doesn't go away. Getting this file directly just shows the image (have changed it to a visible image to make sure it works), it loads nice and quick.
The included .js is:
function stim() {
cimg=new Image();
reff=document.referrer;
cimg.src="http://www.bugfoo.com/c.php?ref="+reff;
}
<body onload="stim()">.
What's likely here? Am I reaping the consequences of being a javascript moron, or is it likely that somehow filesize isn't returning the correct content length? Any input much appreciated.
nb: just ditching the content-length header doesn't change anything
At the moment, when I view the page with firefox, the status bar shows 'Transferring data from [domain.com]', and doesn't go away.
I see this all the time in Firefox - it could just be a manifestation of this bug:
[bugzilla.mozilla.org...]