Click to See Complete Forum and Search --> : google search with "site:"


rock
04-22-2003, 05:15 PM
I'd like to include a search box that automatically appends "site:www.sun.com" for example to the query.

The basic code is:

<form action="http://www.google.com/search" method=get>
<input name=q size=40 value="">
<input type=submit value="Search" name="submit">
</form>


I'm pretty sure I need another input tag, and I've tried things like:

<input type="hidden" name="site:" value="www.sun.com">
or
<input type="hidden" name="+" value="www.sun.com">
or
<input type="hidden" name="" value="site:www.sun.com">

but nothing has worked.

In the end, the actual URL should be for the user input of "blade":
http://www.google.com/search?q=blade+site%3Awww.sun.com

The blade query comes through fine, but whenever I add the + manually, I get a %2B instead. And it gets tacked on as another query.

Any suggestions?

rock
04-23-2003, 03:17 PM
I finally found it. The missing piece:
<input type=hidden name=as_sitesearch value="www.sun.com">