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.

34 lines
1.0 KiB

  1. <?php // generate an html page from database objects
  2. // import database configuration and functions
  3. require("db.php3");
  4. require("html.php3");
  5. // get page info from the database
  6. $connection = connect($host, $dbname);
  7. if($connection) {
  8. // setup page query
  9. $query = "select * from page where content = \"$content\"";
  10. $result = query($connection, $query);
  11. $count = numrows($result);
  12. if($count) {
  13. $page = fetch_object($result,0);
  14. free_result($result);
  15. $pid = start($page);
  16. // query for page items
  17. $query = "select * from item where pid=\"$pid\" order by ord";
  18. $result = query($connection, $query);
  19. $count = numrows($result);
  20. if($count) { // call a $type function for each item
  21. for($row=0; $row < $count; $row++) {
  22. $data = fetch_object($result, $row);
  23. $function = (($data->type) ? $data->type : "text");
  24. $function($data);
  25. }
  26. free_result($result);
  27. } else { include("unfinished.php3"); }
  28. finish($page);
  29. } else { include("unavailable.php3"); }
  30. close($connection);
  31. }
  32. ?>