get_Question_Categories(); $type = filter_input(INPUT_POST, 'type', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => "/Unix|Windows/", 'flag' => FILTER_NULL_ON_FAILURE]]); $cat_id = (int) filter_input(INPUT_POST, 'cat', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); if (!$cat_id) { $cat_id = (int) filter_input(INPUT_GET, 'cat', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); } $action = filter_input(INPUT_POST, 'action', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE); if ($type) { $db->set_Questions($type, $cat_id); } if ($action) { $questions = $db->get_Questions($cat_id, $type); foreach ($questions as $key => $ques) { $ques->answer = isset($_REQUEST[$ques->key]); $db->set_QA($cat, $ques); } header("Location: /ste"); } $title_prefix = "Category Interview"; include_once 'header.inc'; ?>