redirecting to google

  • Thread starter Thread starter jerm.hannley
  • Start date Start date
J

jerm.hannley

I am creating a webpage for my office. The start page is a search
engine that searches a company database.
it consists of a text box and a button called search.

I was wondering if i could add another button that would say 'Search
Internet' and if the user selects this redirect to google or yahoo or
whatever given keywords that they enterd in the text box.

thanks
redhanz
 
Hi,

I am creating a webpage for my office. The start page is a search
engine that searches a company database.
it consists of a text box and a button called search.

I was wondering if i could add another button that would say 'Search
Internet' and if the user selects this redirect to google or yahoo or
whatever given keywords that they enterd in the text box.

thanks
redhanz

Google has many APIs, which are rather easy to use. Check this page for
the Google Search APIs:

http://code.google.com/

Since Google uses GET in their search pages, it's quite easy to find out
which is the query string syntax. For example, a search for Laurent
Bugnion has this form:

http://www.google.ch/search?hl=en&q=Laurent+Bugnion&btnG=Google+Search&meta=

The parameter "hl" is obviously for the language, and "q" is the
question. A simple try confirms it:

http://www.google.ch/search?hl=de&q=Lords+of+the+rings

This self-made URL returns a page in german with "Lords of the rings" as
search string. So it's quite easy to send a search request to Google
without using any API if needed.

HTH,
Laurent
 
Have a simple form (no runat=server) such that the action is set to
something like:
http://www.google.com/search
or similarly for yahoo!

HTH

Or another way out may be that on click of the 'Search Internet' button, you
dynamically update the action of the form from 'search.aspx' to
'http://www.google.com/search' and provide appropriate query string.
 
Back
Top