"); print (" "); print (" "); print (" "); print (" "); print ("
"); print (" $message"); if ($link == true) { printf ("
Click here to retry your search."); } print ("
"); print (""); print ("
"); } /* Construct the url */ $url = "https://slackware.uk/cgi-bin/searchapi.cgi?"; if (isset ($_GET[l])) { $url = $url . "l=$_GET[l]&"; } if (isset ($_GET[p])) { $url = $url . "p=$_GET[p]&"; } else { $url = $url . "p=/&"; } if (isset ($_GET[q])) { $url = $url . "q=" . str_replace (" ", "+", $_GET[q]); } else { $url = $url . "q="; } /* Query the search API */ if ($fh = fopen ($url, "r")) { /* Read and extract the status number */ $status_line = stream_get_line ($fh, 0, "\n"); $status = explode (":", $status_line); if ($status[1] == "0") { ?>
Search Results

Search query:
Searches may contain multiple terms, include (basic) globs,
and descend down from the current directory.

$result_line
"); $count++; } /* Output a total */ if ($count == 0) { print (" No results - try to widen your search."); } elseif ($count == 1) { print (" " . $count . " result found."); } else { print (" " . $count . " results found."); } ?>