0) $ptitle = UCWords($category)." Category Listing"; else $ptitle = "Search Results for ".$criteria; $pkeys = "free recipe, healthy recipe, italian recipe, lasagna recipe"; $pdesc = "Food recipe results for ".$criteria.$category; include_once("header.php"); $string = ""; if(strlen($category) > 0) { $string = " AND category LIKE '".mysql_real_escape_string($category)."%'"; } if(strlen($criteria) > 0) { $temp55 = mysql_query("INSERT INTO recent (term) VALUES ('".mysql_real_escape_string($criteria)."')"); $temp1 = mysql_query("SELECT * FROM recipes WHERE title LIKE '%".mysql_real_escape_string($criteria)."%'$string"); $total = mysql_numrows($temp1); } elseif(strlen($string) > 0) { $temp1 = mysql_query("SELECT * FROM recipes WHERE category LIKE '".mysql_real_escape_string($category)."%'"); $total = mysql_numrows($temp1); } else { $error = "ERROR: You must enter some search criteria.
"; } ?>
SEARCH RESULTS FOR ( results)
0) echo $error; else { if($total == 0) echo "There are no search results for that criteria, please try again or browse by category on the left."; else { $temp = mysql_query("SELECT * FROM recipes WHERE title LIKE '%".mysql_real_escape_string($criteria)."%'$string ORDER BY title LIMIT $start, $perpage"); while($row = mysql_fetch_array($temp)) { $title = str_replace(" ", "-", $row[title]); $title = str_replace("/", "-", $title); $title = str_replace("*", "", $title); $title = str_replace("'", "", $title); $title = str_replace("\"", "", $title); $title = str_replace("(", "", $title); $title = str_replace(")", "", $title); $title = str_replace("#", "", $title); $title = str_replace("&", "", $title); $title = str_replace("$", "", $title); $title = str_replace("!", "", $title); $title = str_replace("", "", $title); $title = str_replace("@", "", $title); $title = str_replace("+", "", $title); $title = str_replace("[", "", $title); $title = str_replace("]", "", $title); $title = str_replace("\\", "", $title); echo "- ".UCFirst($row[title])."
"; } ?>

$perpage) { $start2 = $start - ($perpage * 2); if($start2 < 0) $start2 = 0; echo "< Previous Page  "; } if($start < $total) echo "  Next Page >"; } } ?>