Optimize - All About Those Books
Many counties have books that are considered classics by their standards, and many times the world's standards as well. Below are a few of those books.
Many counties have books that are considered classics by their standards, and many times the world's standards as well. Below are a few of those books.
<?php
// code
error_reporting(E_ALL); // set error reporting to all
// init all arrays
$books[1] = array(
'Title' => "The Fellowship of the Ring",
'Full Title' => "",
'Original Title' => "",
'Author' => "J.R.R. Tolkien",
'Published' => "1954",
'Pages' => "423 (first edition)",
'Original Language' => "English"
);
$books[2] = array(
'Title' => "War and Peace",
'Full Title' => "",
'Original Title' => "Война и миръ",
'Author' => "Leo Tolstoy",
'Published' => "1867",
'Pages' => "1,225 (first edition)",
'Language' => 'Russian, with portions of French and German'
);
$books[3] = array(
'Title' => "Don Quixote",
'Full Title' => "The Ingenious Gentleman Sir Quixote of La Mancha",
'Original Title' => "El ingenioso hidalgo don Quijote de la Mancha",
'Author' => "Miguel de Cervantes",
'Published' => "Part One: 1605; Part Two: 1615",
'Pages' => "928 (Barnes & Nobel edition)",
'Language' => 'Spanish'
);
$books[4] = array(
'Title' => "The Count of Monte Cristo",
'Full Title' => "",
'Original Title' => "Le Comte de Monte-Cristo",
'Author' => "Miguel de Cervantes",
'Published' => "1844 - 1846; Published in volumes",
'Pages' => "1,267 (unabridged, Penguin Classics)",
'Language' => 'French'
);
$books[5] = array(
'Title' => "To Kill a Mockingbird",
'Full Title' => "",
'Original Title' => "",
'Author' => "Harper Lee",
'Published' => "1960",
'Pages' => "281 (first edition)",
'Language' => 'English'
);
$books[6] = array(
'Title' => "Snow White",
'Full Title' => "Grimms' Fairy Tales (Children's and Household Tales); Snow White",
'Original Title' => "Kinder- und Hausmärchen; Schneewittchen",
'Author' => "German Folklore, popularized by Brothers Grimm",
'Published' => "1854 (final revision)",
'Pages' => "",
'Language' => 'German'
);
// get POST vars
$step = isset($_POST['step']) ? $_POST['step'] : 0;
$index = isset($_POST['books']) ? $_POST['books'] : 0;
include('../includes/header4.php');
echo('<h1> Optimize - All About Those Books</h1>');
if ($step == 0)
{ // first time into this form
?>
<p>
Many counties have books that are considered classics by their standards,
and many times the world's standards as well. Below are a few of those books.
</p>
<form action="" method="post">
<input type="radio" id="1" name="books" value=1>
<label for="Book Title"><?php echo($books[1]['Title']) ?></label>
<br>
<input type="radio" id="2" name="books" value=2>
<label for="Book Title"><?php echo($books[2]['Title']) ?></label>
<br>
<input type="radio" id="3" name="books" value=3 >
<label for="Book Title"><?php echo($books[3]['Title']) ?></label>
<br>
<input type="radio" id="4" name="books" value=4 >
<label for="Book Title"><?php echo($books[4]['Title']) ?></label>
<br>
<input type="radio" id="5" name="books" value=5 >
<label for="Book Title"><?php echo($books[5]['Title']) ?></label>
<br>
<input type="radio" id="6" name="books" value=6 >
<label for="Book Title"><?php echo($books[6]['Title']) ?></label>
<br> <br>
<input type="hidden" name="step" value="1">
<input type="submit" value="Submit">
</form>
<br><br>
<?php
}
else
{
foreach ($books[$index] as $key => $value)
{
if ($value != null)
{
echo("<span class='bold'>$key:</span> $value<br>");
}
}
?>
<br><br>
<form action="" method="POST">
<input type="hidden" name="step" value="0">
<input type="submit" name="submit" value="Try Again">
</form>
<?php }
include('../includes/footer4.php');
?>
Last modified: March 21 2022
Line Count: 131