All pastes #75196 Raw Edit

l4m3

public php v1 · immutable
#75196 ·published 2006-06-29 22:10 UTC
rendered paste body
<?php// Include MySQL classrequire_once('inc/mysql.class.php');// Include database connectionrequire_once('inc/global.inc.php');// Include functionsrequire_once('inc/functions.inc.php');// Start the sessionsession_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><?phpif(isset($_GET['keywords'])){$keywords = $_GET['keywords'];} 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 ."{$row['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>