Beispiel #1
0
$operaWidthRawVariable;
$konquerorWidthRawVariable;
$lynxWidthRawVariable;
$tableArray;
/*check if the submit button has been pressed (html form has been submitted) to prevent an 'index:undefined index:' error from occuring. The following code
will only be executed after the form has been submitted. */
if (isset($_POST['submit'])) {
    //escape all form data to protect against injection!
    $name = mysql_real_escape_string($_POST['usersName']);
    $email = mysql_real_escape_string($_POST['usersEmail']);
    $browser = mysql_real_escape_string($_POST['usersFavBrowser']);
    $reason = mysql_real_escape_string($_POST['usersReason']);
    $databaseController = new DatabaseController($name, $email, $browser, $reason);
    $databaseController->connectToDatabase();
    $databaseController->submitToDatabase();
    $databaseController->orderDatabase();
    $databaseController->browserCount();
    $browserPercentUsageArray = $databaseController->getPercentageArray();
    foreach ($browserPercentUsageArray as $key => $value) {
        if ($key == 'ie') {
            $internetexplorerWidthVariablePercentage = $value;
        } elseif ($key == 'ff') {
            $firefoxWidthVariablePercentage = $value;
        } elseif ($key == 'saf') {
            $safariWidthVariablePercentage = $value;
        } elseif ($key == 'chr') {
            $chromeWidthVariablePercentage = $value;
        } elseif ($key == 'op') {
            $operaWidthVariablePercentage = $value;
        } elseif ($key == 'kon') {
            $konquerorWidthVariablePercentage = $value;