rendered paste body<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><?php // Include the database information. require("include/database.php"); require("include/opensession.php"); require("include/character_functions.php"); // Check if we need to verify an answer. if(isset($_POST['charid'])) { // We do. $responsecheck = 1; } else { // We don't. $responsecheck = 0; } if($responsecheck == 0) { // Get a new character to display. getCharacter("new"); } else if($responsecheck == 1) { getCharacter($_POST['charid']); if($_POST['reading'] == $char_array['reading']) { // The answer is correct. $correctAns = 1; // Get a new character. getCharacter("new"); } else { // The answer is incorrect. $correctAns = 0; } } ?><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Kanji for Gaijin - Retrieve Test</title> </head> <body> <div id="container"> <div id="correctness"> <p> <?php if($correctAns == "0") { echo "Incorrect! Try again! <br /><br />"; } else if ($correctAns == "1") { echo "Correct! <br /><br />"; } ?> </p> </div> <div id="character"> <p> <?php echo $char_array['character']; ?> </p> </div> <div id="response_form"> <form name="response" method="post" action="index.php"> <strong>Reading: </strong> <input type="text" name="reading" size="50" /> <input type="hidden" name="charid" value="<?php echo $char_array['id']; ?>" /><br /> <input type="submit" name="submitButton" value="Check" /> </form> </div> </div> </body></html><?php mysql_close();?>