<HTML>
<HEAD>
<TITLE>Story Array Game</TITLE>
</HEAD>
<BODY>
<font SIZE=4 COLOR="Red"> Story Array Game</font>
<BR />
<FONT SIZE=4 COLOR="Red">Please fill in the appropriate fields below: </FONT>
<?php
require('story_arrays.php'); // grabs the corresponding case from the story_arrays file
$storyid = rand(1,3); // randomly generates a story in the $storyid array
$storystructure = getStoryArray($storyid); // establishes which $storystructure array case to use
?>
<FORM ACTION= "part3_story.php" METHOD=post> <!-- creates the form in order for the whole process to execute -->
<table border="1" bgcolor="orange">
<?php
/* This script retrieves the corresponding story array.
The conditional then prints the value. */
foreach ($storystructure as $label) {
echo "<tr><td>".$label."</td>";
echo "<td><input type=text name=$label; ></td></tr>";
}
?>
</table>
<input type=hidden name=storyid value="<?php echo $storyid; ?>" />
<input type=submit name=submit value=submit />
</FORM>
<BR>
</BODY>
</HTML>
Bookmarks