redirecting to google

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
 
L

Laurent Bugnion [MVP]

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
 
G

Gaurav Vaish \(www.Edujini-Labs.com\)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top