A Digital Age Deserves A Digital Leader

speed detection script wanted

speed detection script wanted

Postby c0ldfyr3 » Fri Oct 06, 2006 10:40 pm

as it states i want to know if it even exists....

i have a highbandwidth site and a low bandwidth site set up for users, But as of right now they have to use two seperate URLs. I want to have a script run that is set in my index file to detect what speed the user is connected at and use a cookie to remember this setting, then send them to the apropriate URL.

I know how to use java to detect the screen rezolution

Code: Select all
<script language="JavaScript1.2">
function ScreenGoToURL(Big,Medium) {
var screen_height = screen.height;
var screen_width = screen.width;
var buffer = (document.all || document.layers ||documentGetElementByID) ? 30 : 48;
if (screen_height >= 768) {
   screen_width = 1024;
   screen_height = 768;
    var window_width = 1024-12;
     var window_height = 768-buffer;
     var window_top = 0;
     var window_left = 0;
     window.open(Big,'','resizable=yes,status=yes,scrollbars=yes,width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + '');

} else {
   screen_width = 800;
   screen_height = 600;
   var window_width =  800-12;
    var window_height = 600-buffer;
   var window_top = 0;
    var window_left = 0;
    window.open(Medium,'','resizable=yes,status=yes,scrollbars=yes,width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + '');

}
}
</script>


is there a way to modify this code and just use it as in include or require_once in my index.php?

or is there another way using just php?
Image
PRO Level 15
User avatar
Posts: 1346
Joined: Sun May 02, 2004 8:49 pm
Location: 127.0.0.1

Postby c0ldfyr3 » Fri Oct 06, 2006 11:16 pm

okay so i found this script...
**edit** it wont show the script so i have added a link to it <a href="http://www15.brinkster.com/c0ldfyr3/index.txt" target="_new">here</a>
and this goes into your body


Code: Select all
<body>
<div id="Layer1">
<img src="56k_image.jpg" alt="loadImage" width="100" height="100" border="0" name="Myimage1"></div>
</body>


but it stores the image in the users cache, how can i stop that.. i dont want it to be stored in the users cache, it seems that if the user visits the site again in a day then they are sent to the wrong version, if they are on 56k then they get sent to the 300k site.
Image
PRO Level 15
User avatar
Posts: 1346
Joined: Sun May 02, 2004 8:49 pm
Location: 127.0.0.1

Postby c0ldfyr3 » Fri Oct 06, 2006 11:28 pm

link fixed
Image
PRO Level 15
User avatar
Posts: 1346
Joined: Sun May 02, 2004 8:49 pm
Location: 127.0.0.1

Postby imnuts » Mon Oct 09, 2006 4:46 am

I think there is an HTML meta tag that can be used in the page header where you can tell the browser to no cache the page that does the bandwidth check. If it doesn't cache the page, hopefully it won't cache the image either and also make it so that anytime someone visits, the test is run again.
Image
PRO SUPREME
User avatar
Posts: 7457
Joined: Wed Mar 24, 2004 5:19 am
Location: Boothwyn, Pennsylvania
Real Name: Mark

Postby c0ldfyr3 » Mon Oct 09, 2006 5:03 am

yeah i added that to the index page.. here it is..
Code: Select all
META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"


but with the "<" and ">" brackets

now if i could get it to display the speed before it refreshed the page. like wait 15 seconds after showing the speed.
Image
PRO Level 15
User avatar
Posts: 1346
Joined: Sun May 02, 2004 8:49 pm
Location: 127.0.0.1

Return to HTML, CSS, and Scripts

Who is online

Users browsing this forum: No registered users and 4 guests

cron
cron