HOWTO: Link to Google Search with hidden site: parameter
I was trying to hack up a little search box to access the local Google search appliance. I know you can search with a query like “foo site:example.com/docs” but I wanted to pass site: in as a form parameter. Here is an example of how to do that:
<form action="http://googleplex.example.com/search">
<input type="text" name="q" />
<input type="hidden" name="as_sitesearch" value="example.com/docs" />
</form>
So, where you might use site: in the search field, you use as_sitesearch as a hidden search parameter. I figured this out by squinting at the Google Advanced Search page.
Post a Public Comment
Danny Howard is 100% responsible for the content on this site, except some of it is stolen.
All rights are reserved, unless otherwise noted. Generally, I'm a BSD guy, so you can assume implicit permission to adapt, modify, and redistribute my intellectual property with appropriate attribution. Except some of this content is itself re-appropriated, so you'd best ask first, especially for commercial use. Thanks!
You can contact me via e-mail: dannyman@toldme.com
Most of http://dannyman.toldme.com/ is powered by WordPress.
If you're hip to RSS and whatnot, you can subscribe to this site.
These links are for dannyman: login AND backlinks