• Searches are not case-sensitive. For example: \"photoshop\", \"Photoshop\", and \"PhotoShop\" are identical.
    \n"; echo "
  • Multiple keywords should be separated by a comma. For example: enter \"xxxx, yyyy\" to search for the words \"xxxx\" AND/OR \"yyyy\".
    \n"; echo "
  • You can select which Boolean value (\"AND\" or \"OR\") to use with your search. \"AND\" searches return results containing all of your keywords. \"OR\" searches return results containing any of your keywords. \"AND\" searches are useful for specific topics, while \"OR\" searches are more general and return more results.

    [Tip: Also, make use of Netscape's or Internet Explorer's \"Find...\" feature in the \"Edit\" menu.]

\n"; echo "
\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n
Boolean search using: and  or
Maximum records returned: 25  50
\n"; echo "
\n"; echo "

\n\n"; } elseif ($show && $key=="") { echo "You did not enter any valid keywords.

\n\n"; echo "search again
\n"; } else { $nkey = ""; $ignored = ""; if ($key) { $key = ereg_replace( ", ", ",", $key );/* strips space after commas */ $tok = strtok($key,","); while ($tok) { if ($tok == "and" || $tok == "or" || $tok == "AND" || $tok == "OR") { $tok = AddSlashes($tok); $ignored = $ignored . $tok . " "; } else { $tok = AddSlashes($tok); $split[] = $tok; $nkey = $nkey . $tok . " "; } $tok = strtok(","); } } else { $split[0]=""; } $nkey = chop($nkey); $order = "filedate DESC"; /* GENERATE QUERY STRING */ $key = ""; $splits = count($split); $k=0; while ($k < $splits) { if ($k==0) { $qs = $searchfield . " LIKE '%" . $split[$k] . "%'"; $key = $split[$k]; } else { $qs = $qs . " $op " . $searchfield . " LIKE '%" . $split[$k] . "%' "; $key = $key . $split[$k]; } $k++; } $qs = $qs . " ORDER BY " . $order; mysql_connect($server,$user,$pass); $query = "SELECT * FROM $table WHERE $qs"; /*echo "debug: query string is " . $query . "

\n";*/ $res = mysql_db_query("$db","$query"); $num = mysql_numrows($res); if ($num==1) { echo "$num file was found that matches your search ($nkey)

\n\n"; } elseif ($num>1) { echo "Here are the $maxrecords most recent files that match your search ($nkey)

\n\n"; } elseif ($num == 0) { echo "No files were found that matched your search. ($nkey)
\nPlease try again using different keywords.

\n\n"; echo "search again"; } if ($num > 0) { echo "\n"; $i = 0; while ($i<$maxrecords && $i<$num) { $relevance = (100-$i); $filedate = mysql_result($res,$i,"filedate"); $filename = mysql_result($res,$i,"filename"); /*$rawdata = mysql_result($res,$i,"rawdata"); $rawdata = StripSlashes($rawdata); $keywords = mysql_result($res,$i,"keywords");*/ if (ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $filedate, $regs)) { $formatteddate = date("F d, Y", mktime(0,0,0,$regs[2],$regs[3],$regs[1])); } if (eregi("^w", $filename)) { $formattedname = $formatteddate . " WaveLinks page"; } else { $formattedname = $formatteddate . " Index page"; } /* ALTERNATING COLORED ROWS */ if (($i+1)%2==0) { $bgcolor = "#ffffff"; } else { $bgcolor = "#fafad2"; } echo "\n\n"; echo "\n\n"; $i++; } echo "
\"\"$formattedname

search again"; } } ?>