<?php
//enable visitors to see the PHP source code of current file
$me basename($_SERVER['PHP_SELF']);
if(isset(
$_GET['showPHP'])){
    
show_source("$me");    
    die();
}
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="assets/css.css" type="text/css" rel="stylesheet"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Fastest bird quiz</title>
<!--This meta element defines keywords for my page:-->
<meta name="keywords" content="Jonas Grolin, sleekram@gmail.com" /> 
<?php 
include("includes/header.inc.php");
?>
</head>
<body>
<div id="wrapper">
<?php 
include("includes/top-navigation.inc.php");
?>

    <div id="center-box">
<?php 
include("includes/header_img.inc.php");
?>
        <div id="left-right-padding">
<?php 
include("includes/navigation.inc.php");
?>
            <div style="clear: left;"></div>
            <h1>Fastest bird quiz</h1>
<?php 
    $question 
'What is the fastest bird in the world?'
    
$answers= array('swift''barn swallow''mallard'); 
    
$right_answer 'peregrine falcon'
    
array_push($answers$right_answer); 
    if(! isset(
$_GET['guess'])){ $quiz_out "<dl id=\"quiz\"> \n 
    <dt>
$question </dt> \n <dd> \n <ul> \n"
    
    
$answer $answers[0]; 
    
$quiz_out .= " <li> <a href=\"?guess=$answer\">$answer</a></li> \n";
    
$answer $answers[1];
    
$quiz_out .= " <li> <a href=\"?guess=$answer\">$answer</a></li> \n"
    
$answer $answers[2]; 
    
$quiz_out .= " <li> <a href=\"?guess=$answer\">$answer</a></li> \n";
    
$answer $answers[3];
    
$quiz_out .= " <li> <a href=\"?guess=$answer\">$answer</a></li> \n";
     
    
//Students: Repeat the above two lines of code 
    // to build <li> and <a> for the remaining $answers 
    
$quiz_out .= "</ul> \n </dd> \n </dl> \n "; }
    else{ 
    
$guess $_GET['guess']; 
    
$quiz_out "<dl> \n <dt>So you think a $guess is it?</dt> \n"
    
    if(
$guess == $right_answer){ $quiz_out .= "<dd>Right you are - well done!</dd> \n </dl> \n"
    
    }
    else{ 
$quiz_out .= "<dd>No, how could you even consider that?</dd> \n"
    }
     
//url without getvars 
     
$url $_SERVER['PHP_SELF']; 
    
$quiz_out .= "<dd><a href=\"$url\">Try again?</a></dd>\n </dl> \n"
    }
     echo 
$quiz_out
?>

        </div>
        <br/>
        <br/>
        <br/>
<?php 
include("includes/footer.inc.php");
?>


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