<?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); $ck->deleteCookies(); } else { echo "No Email Set - Go back and enter an email address<br /><br />"; } } ?> <a href="list.php">View The Document List</a> </body> </html>