if ($contestObj->{$postVar} == 1) { $contestObj->{$postVar} = 0; } elseif ($contestObj->{$postVar} == 0) { $contestObj->{$postVar} = 1; } break; default: $contestObj->{$postVar} = filter_input(INPUT_GET, $postVar) ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_GET, $postVar)) : ''; if ($contestObj->{$postVar} === "") { array_push($errorArr, " {$postVar} "); } break; } } if (count($errorArr) < 1) { echo Contest::updateSingle($dbObj, ' status ', $contestObj->status, $contestObj->id); } else { $json = array("status" => 0, "msg" => $thisPage->showPlainErrors($errorArr)); $dbObj->close(); //Close Database Connection header('Content-type: application/json'); echo json_encode($json); } } if (filter_input(INPUT_POST, "deleteThisContest") != NULL) { $postVars = array('id', 'header', 'logo'); // Form fields names $contestHeader = ""; $contestLogo = ''; //Validate the POST variables and add up to error message if empty foreach ($postVars as $postVar) {