ok so here's how i figure i'll handle the first step (getting the search terms sent to the file where we are dong the searching)
<form name="search" method="post" action="school_search.php">
Seach for: <input type="text" name="find" /> in
<Select NAME="field">
<Option VALUE="SchoolName">School Name</option>
<Option VALUE="SchoolDistrict">School District</option>
<Option VALUE="State">State</option>
</Select>
<input type="hidden" name="searching" value="yes" />
<input type="submit" name="search" value="Search" />
</form>
that was cake. so here's how i think i should handle the searching of the database and returning the results back to joomla.
<?php
$searchdbhost = 'localhost';
$searchdbuser = 'blarg';
$searchdbpass = 'honk';
$searchdbname = 'listofschools';
$searchtable = 'SchoolList';
//Check to see if user actually submitted something
//If they did not enter a search term we give them an error
if ($_POST['find'] == ""){
echo "<p>You forgot to enter a search term</p>";
exit;
}
// Otherwise we connect to our Database
mysql_connect($searchdbhost, $searchdbuser, $searchdbpass) or die(mysql_error());
mysql_select_db($searchdbname) or die(mysql_error());
// We preform a bit of filtering
$find = $_POST['find'];
$find = strtoupper($find);
$find = strip_tags($find);
$find = trim ($find);
$field = $_POST['field'];
//Now we search for the school in question
$query = "SELECT * FROM $table WHERE upper($field) LIKE '%$find%' LIMIT 50";
$data = mysql_query($query) or die(mysql_error());
//And we return the results to the referring joomla page
?>
<form onload="submitform()" action="<?php echo getenv("HTTP_REFERER"); ?>">
<input type="hidden" name="searching" value="yes" />
<?php
foreach ($results as $key => $value){
echo '<input type="hidden" name="results[]" value="'.htmlspecialchars($value).'">';
}
?>
</form>