'); print ('
'); print (' Search Error

'); print (' ' . $message . ''); if ($link == true) { print ('

Click here to retry your search.'); } print ('
'); print (''); } /* Construct the url */ if (isset ($_SERVER["HTTPS"])) { $url = "https://"; } else { $url = "http://"; } $url .= $_SERVER["HTTP_HOST"] . "/cgi-bin/searchapi.cgi?"; if (isset ($_GET["l"])) { $url .= "l=" . urlencode ($_GET["l"]) . "&"; } if (isset ($_GET["p"])) { $url .= "p=" . urlencode ($_GET["p"]) . "&"; } else { $url .= "p=%2F&"; } if (isset ($_GET["q"])) { $url .= "q=" . urlencode ($_GET["q"]); } else { $url .= "q="; } /* Query the search API */ if ($fh = fopen ($url, "r")) { /* Read and extract the status number */ $status_line = stream_get_line ($fh, 0, "\0"); $status = explode (":", $status_line); /* Process the status code and output content */ if ($status[1] == "0") { ?>
Search Results
Searches may contain multiple terms, include globs (man 7 glob)
and descend down from the current directory.

Adjust search:
Search path: " autocomplete="on" required>
Search query: " autocomplete="on" required>


' . $entry . '
'); $count++; } elseif ($type == "d") { print ('• ' . $entry . ' (Repeat search in this directory)
'); $count++; } } /* Output a total */ if ($count == 0) { print ("No results - try to widen your search."); } elseif ($count == 1) { print ("1 result shown."); } else { print ($count . " results shown."); } ?>