 
<?php include 'students_02_include.php'; ?>

 <div >
<br><br>
 &nbsp;
 <br>
 <h2>This is the second example, name quize. What is this student's name? </h2>
<?php




if(isset($_POST['submit']))
{

$quizanswer=$_POST['quizstudent'];
$quizphoto=$_POST['quizstudentphoto'];

 echo "<img src=\"$quizphoto\" width=\"100px\">";
 


    // Check answer
    if($_POST['answer'] == "$quizanswer")
    {   
     
        echo "<p>YEAY! You got it! Student's name is <b> $quizanswer</b></p>";
    } else {
        echo "<p>That is incorrect.Student's name is <b> $quizanswer </b> </p>";
    }
}


 $quiznum=rand(0,9);


echo "<img src=\"$studentphotos[$quiznum] \"width=\"100px\">";
?>



 
 
<form method="post" action="students_02_form.php">
<input name="answer" type="text" />
<input type="hidden" name="quizstudent" value="<?php echo $studentnames[$quiznum]?>">
<input type="hidden" name="quizstudentphoto" value="<?php echo $studentphotos[$quiznum]?>">

 <input name="submit" type="submit" value="Check answer" />
</form>      
 
 
</div>




 










 </div>
 
</body>
</html>