Location: PHPKode > projects > The Referral Database > referralsdb/results.php
<?php
  session_start();
  header("Cache-control: private");
  include ('referrals_fns.php');

  $searchterm = $_POST['searchterm'];

  if (!$searchterm)
  {
  do_html_header("Please enter a search term.");
     echo "You have not entered search keywords.  Please try again.";
     do_html_footer();
     exit;
  }

   // from organization_fns.php
   $keyword_array = keyword_search($searchterm);  
   $errlevel = $keyword_array[0];

   if ("0" == $errlevel) {
      do_html_header("Program execution error");
      echo_db_error();

   } elseif ("2" == $errlevel) {
      $searchterm = $keyword_array[1];
      do_html_header("Invalid search criteria");
      echo "I'm sorry, \"$searchterm\" is not a suitable search criteria.<BR>";

   } elseif ("1" == $errlevel) {
      $searchresults = $keyword_array[1]; 
      $searchterm = $keyword_array[2]; 
      $numresults = $keyword_array[3]; 
      do_html_header("Search Results for term \"$searchterm\"");
      display_organizations($searchresults, $searchterm, $numresults);
      echo "$numresults results listed.";

   } elseif ("3" == $errlevel) {
      $invalid_searchterm = $keyword_array[1];
      do_html_header("No results for keyword \"$searchterm\"");
      echo "No results found.";
   }

   do_html_footer();
?>

Return current item: The Referral Database