Tuesday, October 16, 2007

Getting Google Search Results On Your Site Without A Google SearchBar

How do?

This is actually fairly simple. All you need to do is create an html form with a text box where users can enter their search terms.

Assuming you've captured the search term(s) in your form, you just need to add them to a static redirect (show that however you want) to the google site.

The only issue that you'd have to really deal with is using "join" (I'm assuming Perl, but adjust to your form processing language of preference) to take your array of terms, if more than one was entered into your form, so that they all become one string with the terms connected by plus (+) symbols.

So your form entry of "mustangs and other cars" would get massaged into:


"http://www.google.com/search?hl=en&q=" would be static and you'd just need to append your search term string to complete the URL

Simple enough - format it to your liking. As far as I know, there's nothing illegal or unethical about it. You just lose out on Adsense revenue, but you save a lot of hassle and don't have to keep your site in line with Google's standards.

Enjoy :)

, Mike