Site Analytics

query("SELECT * FROM `".$config->database['prefix']."browsers` ORDER BY id"); // Query. $total = mysql_num_rows($result); // Total rows. // Define some variables that will do a lot of the math. $msie = 0; $firefox = 0; $opera = 0; $other = 0; // Other string variables $msie_string = "MSIE"; $firefox_string = "Firefox"; $opera_string = "Opera"; // Here we go ... gotta count up the tally! while($user = mysql_fetch_array($result)) { $check = strpos($user['agent'], $msie_string); if ($check !== true) { $msie++; } else { $check = strpos($user['agent'], $firefox_string); if ($check !== true) { $firefox++; } else { $check = strpos($user['agent'], $opera_string); if ($check !== true){ $opera++; } else { $other++; } } } } // Now we do some tough mathmatical calculations. //$msie = ceil($total/$msie); //$firefox = ceil($total/$firefox); //$opera = ceil($total/$opera); //$other = ceil($total/$other); // Now we echo the data! echo "".$msie."% of visitors are using Microsoft Internet Explorer
"; echo "".$firefox."% of visitors are using Mozilla Firefox
"; echo "".$opera."% of visitors are using Opera
"; echo "".$other."% of visitors are using other browsers"; ?>