Hello. Can someone look at this code and see where i miss up at. i can only look at it for so long. Thanks Bill Nash.
results.php
<head>
<title>William R. Nash Calendar Results</title>
</head>
<body>
</h1>William R. Nash Calendar 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);
@ $db=mysql_pconnect("localhost","school","");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
mysql_select_db("class");
$query="select * from class where ".$searchtype." like
'%".$searchterm."%'";
$result=mysql_query($query);
$num_results=mysql_rows($result);
echo "<p>Number of classes found: ".$num_results."</p>";
Search.html
<head>
<title>William R. Nash Calendar</title>
</head>
<body>
<h1>William R. Nash Calendar Page.</h1>
<br>
Please Select which class you want to sign up for.
<form action="results.php" method="post">
choose search type:<br>
<select name="searchtype">
<option value="BLSHCP">BLS Health Care Provider
<option value="BLSHCPF">BLS HCP Fundamentals
<option value="BLSHSAED">BLS Heart Saver AED
<option value="BLSHSFACT">BLS Heart Saver Facts
<option value="BLSFAMILY">BLS CPR for Family & Friends
<option value="CPRSCHOOL">CPR in Schools
<option value="BLSHSCPR">BLS HS CPR
<option value="BLSINSTRUCTOR">BLS Instructor
<option value="BLSIT">BLS IT
<option value="ACLSProvider">ACLS Provider
<option value="ACLSInstructor">ACLS Instructor
<option value="ACLSEPPROVIDER">ACLS EP Provider
<option value="ACLSEPINSTRUCTOR">ACLS EP Instructor
<option value="PALSPROVIDER">PALS Provider
<option value="PALSINSTRUCTOR">PALS Instructor
</select>
<br>
<br>
Enter month in which you would like to attend:<br>
<select name="searchterm">
<option value="jan">January
<option value="feb">February
<option value="mar">March
<option value="apr">April
<option value="may">May
<option value="jun">June
<option value="jul">July
<option value="aug">August
<option value="sep">September
<option value="oct">October
<option value="nov">November
<option value="dec">December
</select>
<br>
<br>
<input type=submit value="search for class">
</form>
</body>