[ PHPXref.com ] [ Generated: Sun Jul 20 16:25:17 2008 ] [ ActionApps 2.8.1b ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> search.php3 (source)

   1  <html>
   2  <head>
   3  <title>Search Results</title>
   4  </head>
   5  <body>
   6  
   7  <?php
   8  //$Id: search.php3,v 1.6 2005/04/24 21:48:11 honzam Exp $
   9  /* 
  10  Copyright (C) 1999, 2000 Association for Progressive Communications 
  11  http://www.apc.org/
  12  
  13      This program is free software; you can redistribute it and/or modify
  14      it under the terms of the GNU General Public License as published by
  15      the Free Software Foundation; either version 2 of the License, or
  16      (at your option) any later version.
  17  
  18      This program is distributed in the hope that it will be useful,
  19      but WITHOUT ANY WARRANTY; without even the implied warranty of
  20      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21      GNU General Public License for more details.
  22  
  23      You should have received a copy of the GNU General Public License
  24      along with this program (LICENSE); if not, write to the Free Software
  25      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  26  */
  27  
  28  require_once  "./include/config.php3";
  29  
  30  require_once ($GLOBALS['AA_INC_PATH'] . "locsess.php3");
  31  require_once ($GLOBALS['AA_INC_PATH'] . "searchlib.php3");
  32  
  33  // Variables that we expect from the input form
  34  
  35  // echo "$search[keyword]<br>"; // search string
  36  // echo "$s_col[0]<br>";        // in which columns in table items to search
  37  // echo "$search[type]<br>";    // AND or OR
  38  
  39  $where = SearchWhere($search, $s_col);
  40  
  41  // echo ("<br>$where<br>");
  42  
  43  $retflds[] = "headline";
  44  $retflds[] = "abstract";
  45  $retflds[] = "full_text";
  46  
  47  
  48  $sql = aa_search_db ($where, $retflds);
  49  
  50  //echo ("<font color=red>$sql</font><br>");
  51  
  52  $db = new DB_AA;
  53  // echo "$db->Host, $db->Database, $db->User, \"$db->Password\"<br>";
  54     
  55  $c = $db->query($sql);
  56  $a = $db->nf();
  57  echo("Number of results: $a<br>");
  58  
  59  echo("<table>");
  60  $i = 0;
  61  while ($db->next_record()) {
  62     while ( list($key, $val) = each($retflds) ) {
  63        printf("<tr><td><b>%s</b></td><td>%s</td></tr>", $val, $db->f($val));
  64        $rs[$i][$val] = $db->f($val);
  65     }
  66     reset($retflds);
  67     $i++;
  68  }
  69  echo("</table>");
  70  ?>
  71  
  72  </body>


[ Powered by PHPXref - Served by Debian GNU/Linux ]