View Full Version : Connection Speed Auto Detection Script
zapsilent
09-19-2007, 10:41 PM
I have spent over 20 minutes going thru several areas of the forums trying to find this script. I believe it is VERY simple and is likely that I just am not searching for the right thing. Thus, i'm breaking down and posting a thread to ask the question.
I am looking for a script that automatically detects the connection speed of the website visitor(s). Basically I have built a site that has flash and static entire sites. I just want those on dialup and low band to automatically go to the static site side. And those with high band / fast speed to automatically go to the flash side of the site.
Anyone know where this script is located? I know it's out here somewhere. I appreciate your assistance.
Respectfully,
Zap
:confused:
Rockonmetal
09-19-2007, 10:44 PM
Hmmm... maybe if someone could do a reaction test to see how long the page took to load *like an index...* and if the page loaded in like 1.3 seconds or less then they go to the flash version, if the page took more than that they would go to the static page... let me see if I can find something that records the time it takes to load...
it will probably require javascript... is that ok???
zapsilent
09-19-2007, 10:46 PM
Absolutely. Anything you can provide. Thanks so much!
Zap
Rockonmetal
09-19-2007, 10:56 PM
I got some php script here it is... if you run off your harddrive your site will always, always recommend to use the flash version, but I'm pretty sure if you put an image *not to big* that you'll get some results...
<?php
$starttime = explode(' ',microtime());
$starttime = $starttime[1] + $starttime[0];
$mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
printf('Page generated in %.3f seconds.', $totaltime);
printf('<h1>Page generated in</h1> %.3f seconds.', $totaltime);
echo "<br>";
if($startime[1]+$startime[0]<=1.3)
//Time in seconds please edit 1.3 to any second number you wish...{
echo "Click the link below to go to the flash version of the site...";
echo "<a href='linktoflashversion'>Click here</a>";
}else{
echo "Please click <a href='linktostaticversion'>Here</a>";
}
?>
Enjoy, hope this works
zapsilent
09-19-2007, 11:05 PM
Much appreciated!
Zap
djr33
09-19-2007, 11:11 PM
I'd suggest leaving it as a choice for the visitor. They might want to wait longer, or, even with a fast connection, go with the simpler view.
Testing this can be a bit hard, and is usually done (for real testing sites, etc.) with a java applet. (Flash might be able to as well.) Using an image is a good way to fake it, though.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.