Hi,
I am looking for a way to detect users connection speed on my pages.
What I want is to determine if a user is connected by a ISDN, 56 kb or slower connection modem or by a fast DSL line.
In order to do this I was thinking about put a 30 kb image or file to be read by the user browser and save time needed to load the complete page (or image) understandig if it is a fast or slower user by the time needed.
Do you think it is possible to do something like that ?
For now I am trying somthing like:
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
function exec_time() {
$mtime = explode( " ", microtime());
$msec = (double)$mtime[0];
$sec = (double)$mtime[1];
return $sec + $msec;
}
$start = exec_time();
include 'http://www.canzoni.it/peso.php';
// where peso.php = <img src="img/speedtrap.jpg" width="470" height="45">
$stop = exec_time();
but is seems not to work because I think stop is executed before the image is loaded.
I was thinking to something like:
file_get_contents
but I think it is not good because it will work locally on server.
Any suggestions about ?
Thank you very mych !