?> <body> <h1>Home Page</h1> <p>A Great Document Website</p> <p>You haven't viewed any documents yet</p> <p><strong>Documents you have viewed:</strong></p> <?php $bookViewed = $ck->booksViewed; foreach ($bookViewed as $kID) { $bookTitle = $dbp->getTitles($kID); echo "<p>{$bookTitle[$kID]}</p>"; } ?> <!--<p>Title Z</p> --> <?php if (isset($_POST['boughtbookid'])) { $userEmail = $_POST['email']; if (!empty($userEmail)) { echo "<p><strong>You have just bought:</strong></p>"; $bookBought = $_POST['bookid']; $boughtTitle = $dbp->getTitles($bookBought); echo "<p>" . $boughtTitle[$bookBought] . "</p>\n\t\t<p>The full document will be sent to you shortly.</p>"; $dbp->logPurchase($bookBought, $userEmail);
<!DOCTYPE html> <HTML> <head> <title>Document List</title> </head> <body> <?php require_once 'cookie/cookie.php'; $ck = new cookieMonster(); require_once 'db\\persistence.php'; $dbp = new persistDisplay(); $titles = $dbp->getTitles(); ?> <h1>Documents</h1> <?php foreach ($titles as $id => $title) { $bId = $ck->getValidBookCookie($id); if ($bId != 0 || $bId != '') { ?> <p><?php echo "*" . $title; ?> <a href="detail.php?id=<?php echo $id; ?> ">More Info</a></p> <?php