Sometimes you may need to add a search web part to your page, but you then discover that WSS 3.0 and SharePoint Foundation 2010 don’t offer them (only included in MOSS 2007 / SharePoint Server 2010). Or you want to add a small search box somewhere within your page and provide some descriptive text around it ("If you can’t find what you’re looking for, enter your search terms in the following box to search this site:") to make it more user-friendly.
Whenever the standard web parts in SharePoint can’t help you, the following solution might be able to solve your needs. While it doesn’t offer the full functionality of said web parts (naturally), it still offers you a very simple, yet effective way to provide a search box and make it easier for your visitors to find relevant content.
What this solution does it to provide a dropdown with search scopes and an input box for the search terms, and combines the selections of both to submit searches to a predefined destination. Depending on your requirements, you can define which search results page should be used here. For example, this can be MOSS 2007’s or SharePoint Server 2010’s Search Center. Alternatively, or also if you’re using WSS 3.0 / SharePoint Foundation 2010, you can submit it to the default search page. In case you have a customised search page, you could even submit it to that one!
All you need to do to get it to run is to add the following code onto your page at your preferred location, for example inside a Content Editor Web Part
If you want to provide the option to search within one or more given lists, you need to update the corresponding dropdown values (in my example above Documents and My Presentations). The value of the OPTION tag has to be the name of the list/library that was used when it was created (when you open it, you can see it as part of the URL), as for the display name you can choose what you prefer.