This is a handy little script that takes all the complexity out of having a "search this site" function on any website. It utilizes the Google API on the backend, so you do not need a database backend. Since it uses Google, you are able to index anything that Google can index (PDF files, Word documents, Excel spreadsheets, etc.) In the end, you only need a single PHP script on your server (search.php).
Search Engine Script Setup Instructions
Requirements
PHP enabled web server that allows usage of fopen() (which is enabled by default).
Edit the search.php file (you need to set your Google API key as well as the site you wish to search near the top of that file). If you don't have a Google API key, you can get one for free from here.
Copy the search.php to your web server.
Put the HTML below onto the web page(s) you wish to have a search function from. If some of the HTML pages are not in the same directory as your search.php, you should change <FORM METHOD="GET" ACTION="search.php"> to <FORM METHOD="GET" ACTION="http://www.yoursite.com/search.php">.
Feel free to alter the search box HTML as well as the search.php file to work it into your site's look/feel. The only thing we ask is that you leave the link to us near the search box. That way if others want to use the service, they can. The links will occasionally be validated, and the search script may stop working if it is removed (this will allow us to keep it a 100% free service without any ads).
Some additional ideas:
You could remove the Search button if you wish, and just have a box (hitting enter would trigger the search).
Instead of hard-coding the site you want to search within the search.php, file, you could pass it as a parameter to the script (via a drop-down list).