{'database'}->{'enable'}) { $ip_matches = $config->{'database'}->{'ip_matches'}; if ( (! $ip_matches) || ($ip_matches && preg_match("/$ip_matches/",$_SERVER['REMOTE_ADDR'])) ) { Debug("Saving to database"); $dbh = mysql_connect( $config->{'database'}->{'host'}, $config->{'database'}->{'user'}, $config->{'database'}->{'password'} ); $dbs = mysql_select_db( $config->{'database'}->{'database'}, $dbh); $table = $config->{'database'}->{'table'}; $ip = $_SERVER['REMOTE_ADDR']; $upspeed = addslashes($_GET['upspeed']); $downspeed = addslashes($_GET['downspeed']); $sql = " INSERT INTO `$table` SET `ip_string` = '$ip', `ip` = INET_ATON('$ip'), `timestamp` = NOW(), `upspeed` = '$upspeed', `downspeed` = '$downspeed' "; mysql_query($sql,$dbh); } } ?> <?php print $config->{'general'}->{'page_title'}; ?> - Fancy Speed Test \n"; } ?>
Download Speed: $clean_down\n"; ## Find the biggest value foreach ($config->{'comparisons-download'} as $key=>$value) { if ($value > $download_biggest) { $download_biggest = $value; } } ## Print a pretty table with a graph of the results print "
\n"; foreach ($config->{'comparisons-download'} as $key=>$value) { $this_bar_width = $bar_width / $download_biggest * $value; print "\n"; } $this_bar_width = $bar_width / $download_biggest * $_GET['downspeed']; print "\n"; print "\n"; print "
$key".CleanSpeed($value)."\n"; print "{'general'}->{'image_path'}; print "bar.gif\" height=\"10\" width=\"$this_bar_width\" alt=\"$value kbps\" />
Your Speed$clean_down{'general'}->{'image_path'} . "bar.gif\" height=\"10\" width=\"$this_bar_width\">
\n"; ## Don't display the upload stuff if we didn't get a speed to compare with if (isset($_GET['upspeed'])) { $clean_up = CleanSpeed($_GET['upspeed']); $upload_biggest = $_GET['upspeed']; print "

Upload Speed: $clean_up

\n"; foreach ($config->{'comparisons-upload'} as $key=>$value) { if ($value > $upload_biggest) { $upload_biggest = $value; } } print "\n"; foreach ($config->{'comparisons-upload'} as $key=>$value) { $this_bar_width = $bar_width / $upload_biggest * $value; print "\n"; print "\n"; } $this_bar_width = $bar_width / $upload_biggest * $_GET['upspeed']; print "\n"; print "
$key".CleanSpeed($value)."{'general'}->{'image_path'} ."bar.gif\" height=\"10\" width=\"$this_bar_width\" alt=\"$value kbps\" />
Your Speed$clean_up"; print "{'general'}->{'image_path'} ."bar.gif\" height=\"10\" width=\"$this_bar_width\">
\n"; } ?>

Test Again

Powered by Fancy Speed Test
1024) { $cleanspeed = round($kbps / 1024,2) . " Mbps"; } else { $cleanspeed = round($kbps,2). " kbps"; } return $cleanspeed; } ?>