return null; } if (date("Y-m-d H:i:s", strtotime($examInfo["startTime"])) > date("Y-m-d H:i:s")) { echo "Your Exam Will Start at '" . $examInfo["startTime"] . "' <br>"; return null; } insertExaminee($_POST["examId"], $_SESSION["currentUser"], $_POST["institutionId"]); echo "successful"; } if (isset($_POST["submitAnswer"])) { $examId = $_POST["examId"]; $questionId = $_POST["questionId"]; $answer = $_POST["answer"]; $check = $_POST["check"]; if ($check == "false") { $result = deleteAnswer($_SESSION["currentUser"], $examId, $questionId, $answer); if ($result == "successfull") { echo "successful"; } else { echo $result; } } else { if ($check == "true") { $result = insertAnswer($_SESSION["currentUser"], $examId, $questionId, $answer); if ($result == "successfull") { echo "successful"; } else { echo $result; } } }
<?php include '../config.php'; include '../functions.php'; deleteAnswer($_POST['answer']);