session_start(); require_once("functions.php"); if ($_SESSION['authenticated'] != true) { die("Access denied"); } print_html_header("Play Trivia"); // Start State if (!$_SESSION['question_num'] || $_POST['action']=="Play Again") { $_SESSION['question_num'] = 1; $_SESSION['points'] = 0; echo '
Get 10 question from database
'; } // Display State else if ($_POST['action']=="Start" || $_POST['action']=="Next Question") { echo 'Display question '.$_SESSION['question_num'].'
'; } // Feedback State else if ($_POST['action']=="Submit") { echo 'Process submission
'; echo 'Print feedback
'; if ($_SESSION['question_num'] < 10) { $_SESSION['question_num']++; echo ' '; } else { // Stop State echo 'Recored score
'; echo 'Print end of game feedback
'; echo ' '; } } print_html_footer(); ?>