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

  1. <?php // member search form
  2. header("Content-type: text/html");
  3. header("Pragma: no-cache");
  4. $basetarget = "main";
  5. include("html/head.std");
  6. include("config/db.config");
  7. include("config/db.functions." . $dbserver);
  8. // connect to the db and build the category list
  9. $connection = connect($host, $dbname);
  10. if($connection) {
  11. $query = "select distinct category from $table";
  12. $result = query($connection, $query);
  13. $count = numrows($result);
  14. // if we return a list of categories,
  15. // build our form for the data query
  16. if($count) {
  17. print("<div class=center>\n<h2>" . ucwords($content));
  18. print(" Search<hr>\n");
  19. print("<form method=\"post\" action=\"search_result.php3\">\n");
  20. print("<table border=0>\n");
  21. print("<tr>\n<td class=label>Category:</td>\n");
  22. print("<td align=left><select name=\"category\">\n");
  23. print("<option value=\"\">--- All Categories ---\n");
  24. for($row = 0; $row < $count; $row++) {
  25. $data = fetch_object($result, $row);
  26. print("<option value=\"" . $data->category . "\">");
  27. print($data->category . "\n");
  28. }
  29. free_result($result);
  30. print("</select></td></tr>\n");
  31. print("<input type=\"hidden\" name=\"content\" value=\"");
  32. print($content . "\">");
  33. include("html/body.search");
  34. } else {
  35. print("<h2 class=center>Empty Result<hr></h2>\n");
  36. print("<h2>The following query returned an empty result:</h2>\n");
  37. print("<p class=center>" . $query . "\n");
  38. }
  39. close($connection);
  40. } else {
  41. print("<h2 class=center>Database Error<hr></h2>\n");
  42. print("<h2 class=center>Failed to connect to database: ");
  43. print($dbname . "</h2>\n");
  44. }
  45. include("html/tail.std");
  46. ?>