Results 1 to 6 of 6

Thread: Connection Speed Auto Detection Script

  1. #1
    Join Date
    Sep 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Connection Speed Auto Detection Script

    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

  2. #2
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default

    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???

  3. #3
    Join Date
    Sep 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Absolutely. Anything you can provide. Thanks so much!

    Zap

  4. #4
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default

    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...
    Code:
    <?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

  5. #5
    Join Date
    Sep 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Much appreciated!

    Zap

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •