Children's Books

BookAuthorIllustrator
Too Many FrogsSandy AsherKeith Graves
GigiSheila WalshMeredith Johnson
MonsterliciousErik SlangerupJohn Sandford
EDT
5.2.8

Source Code for Book Table

<?php

$title 
= array('Book','Author','Illustrator');

$item[0] = array('Too Many Frogs','Sandy Asher','Keith Graves');
$item[1] = array('Gigi','Sheila Walsh','Meredith Johnson');
$item[2] = array('Monsterlicious','Erik Slangerup','John Sandford');
echo(
'<table>');
echo(
'<tr>');
foreach(
$title as $header){
    echo(
'<th>' $header '</th>');
}
echo(
'</tr>');

foreach(
$item as $books){
    
//iterate
    
echo('<tr>');
foreach(
$books as $contents){
        echo(
'<td>' $contents '</td>');
}
//end inner foreach
    
echo('</tr>');
}
//end outter foreach
echo('</table>');

?>

Source Code for Current Page

<?php $siteName 'LzyDaz Designs<br /><em><span class="white-text">www.lzydaz.com</span></em>'?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Children's Book List Table</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link href="<?php ($_SERVER['DOCUMENT_ROOT']); ?>/lvs/php101/common/site.css" rel="stylesheet" type="text/css" />
<link href="<?php ($_SERVER['DOCUMENT_ROOT']); ?>/lvs/php101/week5/common/week5.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div id="head">
<p><?php echo $siteName?></p>
</div><!--close #head-->

<div id="wrap">
<div id="content">

<div id="bar-nav">
<?php include($_SERVER['DOCUMENT_ROOT'] . '/lvs/php101/includes/bar-nav.php'); ?>
</div><!--close bar-nav-->



<div id="navcontainer">
<ul> 
<li><a href="../week5.php" title="Return to Main">Main</a></li>
<li><a href="dice.php" title="Dice Game Revised">Game</a></li>
<li class="last"><a href="contact.php" title="Contact Form">Contact</a></li>
</ul>
</div><!-- close navcontainer -->

<div id="book">

<h1>Children's Books</h1>

<?php include($_SERVER['DOCUMENT_ROOT'] . '/lvs/php101/week5/includes/bookTable.php'); ?>

</div><!--close #book-->

</div><!--close #content-->
</div><!--close #wrap-->

<div id="foot">
<?php include($_SERVER['DOCUMENT_ROOT'] . '/lvs/php101/includes/copyright.php'); ?>
</div><!--close #foot-->

<div id="source">
<?php echo date("T"); ?>
<hr />
<?php echo phpversion(); ?>
<hr />
<p>Source Code for Book Table</p>
<?php show_source($_SERVER['DOCUMENT_ROOT'] . '/lvs/php101/week5/includes/bookTable.php'); ?>
<p>Source Code for Current Page</p>
<?php show_source(basename($_SERVER['PHP_SELF'])); ?>
</div><!--close #source-->

</body>
</html>