rendered paste body<?php
// Include MySQL class
require_once('inc/mysql.class.php');
// Include database connection
require_once('inc/global.inc.php');
// Include functions
require_once('inc/functions.inc.php');
// Start the session
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Shopping Cart Demo - Search!!</title>
<link rel="stylesheet" href="css/styles.css" />
</head>
<body>
<div class="all">
<div id="navcontainer">
<ul id="navlist">
<li><a href="index.php" id="current">See List</a></li>
<li id="active"><a href="search.php">Search</a></li>
<li id="last"><a href="cart.php">View Cart</a></li>
</ul>
</div>
<?php
if(isset($_GET['keywords']))
{
$keywords = $_GET['keywords'];
}
echo "<div id=\"shoppingcart\">";
echo "<h1>Please enter a search:</h1>";
echo "<form name=\"form\" action=\"search.php\" method=\"get\">";
echo "<input type=\"text\" name=\"keywords\" />";
echo "<input type=\"submit\" name=\"Submit\" value=\"Search\" />";
echo "</form>";
echo "</div>";
if ($keywords == "") {
echo "<br><br><br><br><br>sorry... you must enter a search value<br><br><br><br><br>";
} else {
echo "<br><br><br><br><br>hey!<br><br><br><br><br>";
echo "<div id=\"booklist\">";
echo "<h1>Your search for ".$keywords." obtained the following results:</h1>";
$row = $result;
$sql = "SELECT * FROM tblcart WHERE Category LIKE '%$keybords%' OR SubCat LIKE '%$keywords%' OR Name LIKE '%$keywords%' ORDER BY ProductID";
$result = $db->query($sql);
$output[] = '<ul>';
while ($row = $result->fetch()) {
$output[] = '<li>'.$row['ProductID'].', '.$row['Category'].', '.$row['SubCat'].', '.$row['Name'].'<br /><a href="/stuff/cart/Products/'.$row['Category'].'/'.$row['SubCat'].'/'.$row['Name'].'.pdf">View This Item</a> | <a href="cart.php?action=add&ProductID='.$row['ProductID'].'">Add To Cart</a></li>';
}
$output[] = '</ul>';
echo join('',$output);
echo "</div>";
}
?>
</div>
</body>
</html>