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>
<form name="form" action="srch.php" method="get">
<input type="text" name="keywords" />
<input type="submit" name="Submit" value="Search" />
</form>
<?php
if(isset($_GET['keyword']))
{
$keywords = $_GET['keywords'];
}
$limit=23;
echo "<div id=\"shoppingcart\">";
if ($keywords == "")
{
echo "<h1>Please enter a search:</h1>";
exit;
}
echo "<div id=\"booklist\">";
echo "<h1>Your search obtained the following results:</h1>";
$sql = 'SELECT * FROM tblcart WHERE `'.$row['Category'].'` LIKE `'.$keywords.'` OR `'.$row['SubCat'].'` LIKE `'.$keywords.'` OR `'.$row['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="cart.php?action=add&ProductID='.$row['ProductID'].'">Add To Cart</a></li>';
}
$output[] = '</ul>';
echo join('',$output);
echo "</div>";
?>
</body>
</html>