Specifications

FIGURE 10.1
The search form is quite general, so you can search for a book on its title, author, or ISBN.
The script that will be called when the Search button is pressed is results.php. This is listed in
full in Listing 10.2. Through the course of this chapter, we will discuss what this script does
and how it works.
LISTING 10.2 results.phpRetrieves Search Results from Our MySQL Database
and Formats Them for Display
<html>
<head>
<title>Book-O-Rama Search Results</title>
</head>
<body>
<h1>Book-O-Rama Search Results</h1>
<?
trim($searchterm);
if (!$searchtype || !$searchterm)
{
echo “You have not entered search details. Please go back and try
again.”;
exit;
}
$searchtype = addslashes($searchtype);
$searchterm = addslashes($searchterm);
Using MySQL
P
ART II
230
13 7842 CH10 3/6/01 3:36 PM Page 230