Olive Branch MS Chamber of Commerce (circa Oct 1999)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

46 lines
1.6 KiB

<?php // member search form
header("Content-type: text/html");
header("Pragma: no-cache");
$basetarget = "main";
include("html/head.std");
include("config/db.config");
include("config/db.functions." . $dbserver);
// connect to the db and build the category list
$connection = connect($host, $dbname);
if($connection) {
$query = "select distinct category from $table";
$result = query($connection, $query);
$count = numrows($result);
// if we return a list of categories,
// build our form for the data query
if($count) {
print("<div class=center>\n<h2>" . ucwords($content));
print(" Search<hr>\n");
print("<form method=\"post\" action=\"search_result.php3\">\n");
print("<table border=0>\n");
print("<tr>\n<td class=label>Category:</td>\n");
print("<td align=left><select name=\"category\">\n");
print("<option value=\"\">--- All Categories ---\n");
for($row = 0; $row < $count; $row++) {
$data = fetch_object($result, $row);
print("<option value=\"" . $data->category . "\">");
print($data->category . "\n");
}
free_result($result);
print("</select></td></tr>\n");
print("<input type=\"hidden\" name=\"content\" value=\"");
print($content . "\">");
include("html/body.search");
} else {
print("<h2 class=center>Empty Result<hr></h2>\n");
print("<h2>The following query returned an empty result:</h2>\n");
print("<p class=center>" . $query . "\n");
}
close($connection);
} else {
print("<h2 class=center>Database Error<hr></h2>\n");
print("<h2 class=center>Failed to connect to database: ");
print($dbname . "</h2>\n");
}
include("html/tail.std");
?>