Created
April 24, 2014 04:43
-
-
Save ajhodges/11241768 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(isset($_GET["blah"])){ | |
//check if correct | |
if($taxonguess == "taxon"){ | |
$correct = true; | |
} else { | |
$correct = false; | |
} | |
} | |
if(!isset($_GET["blah"]) || $correct){ | |
//generate new answer stuff | |
$dino_img = $link_to_new_dino_img; | |
$dino_taxon = $new_dinos_taxon; | |
} else { | |
$dino_img = $link_to_old_dino_img; | |
$dino_taxon = $old_dinos_taxon; | |
} | |
?> | |
<html> | |
<body> | |
<?php if(isset($correct)): ?> | |
<div class="alert alert-<?php echo $correct ? "success" : "danger"; ?> container"> | |
<?php if($correct): ?> | |
<strong>Well done!</strong> You successfully answered this question! | |
<?php else: ?> | |
<strong>Oops!</strong> Check your spelling and try submitting again. | |
<?php endif;?> | |
</div> | |
<?php endif; ?> | |
<img src="<?php echo $dino_img; ?>"/> | |
...etc, put <?php echo $dino_taxon; ?> in the hidden input | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment