{'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);
}
}
?>
Download Speed: $clean_down\n";
print "
Speed Test
\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 "$key | ".CleanSpeed($value)." | \n";
print "{'general'}->{'image_path'};
print "bar.gif\" height=\"10\" width=\"$this_bar_width\" alt=\"$value kbps\" /> |
\n";
}
$this_bar_width = $bar_width / $download_biggest * $_GET['downspeed'];
print "Your Download Speed | \n";
print "$clean_down | {'general'}->{'image_path'} . "bar.gif\" height=\"10\" width=\"$this_bar_width\"> |
\n";
print "Full HD 1080P Channels Require minimum | 15.00 Mbps |
\n";
print "Regular HD Channels Require minimum | 8.00 Mbps |
\n";
print "Standard Channels Require minimum | 5.00 Mbps |
\n";
print "
\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 "$key | ".CleanSpeed($value)." | \n";
print "{'general'}->{'image_path'} ."bar.gif\" height=\"10\" width=\"$this_bar_width\" alt=\"$value kbps\" /> |
\n";
}
$this_bar_width = $bar_width / $upload_biggest * $_GET['upspeed'];
print "Your Speed | $clean_up | ";
print "{'general'}->{'image_path'} ."bar.gif\" height=\"10\" width=\"$this_bar_width\"> |
\n";
print "
\n";
}
?>
1024) {
$cleanspeed = round($kbps / 1024,2) . " Mbps";
} else {
$cleanspeed = round($kbps,2). " kbps";
}
return $cleanspeed;
}
?>