PHP documentation searchability
| From: | Benjamin Smith | Date: | Thu, 05 Sep 2002 16:29:01 +0000 |
| Subject: | PHP documentation searchability | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-12308@lists.php.net to get a copy of this message | ||
Downloaded the documentation for PHP so that I could host it here and save you the bandwidth.
However, I was surprised to find that the documentation download consists only of .html files, and
doesn't contain any search code!
I don't quite understand your motivations for this - even a rudimentary search engine would be
very helpful and would mitigate the surely heavy load of hits you're serving.
Here's a simple something I hacked together... renamed index.html to index.ihtml (so that
apache wouldn't pick it up) and then made this index.php:
<SNIP>
<?
IF ($search=trim($_REQUEST[search]))
{
if (file_exists('./function.'.$search.'.html'))
header('location: function.'.$search.'.html');
elseif (file_exists('./functions.'.$search.'.html'))
header('location: functions.'.$search.'.html');
else echo "<FONT COLOR=RED>No matching function(s) found</font>";
}
?>
<FORM METHOD=POST ACTION='index.php'>
<INPUT TYPE=TEXT NAME=search VALUE="<?
echo htmlentities($search); ?>">
</FORM>
<? include './index.ihtml'; ?>
?>
</SNIP>
-Ben
"The best way to predict the future is to invent it"