Help - Search - Members - Calendar
Full Version: HTML Help
Hydrogenaudio Forums > Misc. > Off-Topic
JEN
Does anyone know how to create a webpage which can link to googles search.

For example, I want a small text box with a button which allows the user to type in something which will link and search in google.

Any ideas on how to do this?
Chun-Yu
Take a look at http://shoko.calarts.edu/~glmrboy/musicdsp...sparchives.html?

EDIT: Oh, nos! I've been beaten by seconds with better information!
JEN
Thanks, that exactly it. Do you know how to do the same thing with Yahoo ???
meatus
Jen,

I'll try to explain the basic concepts of HTML forms. In a URL string, the ? represents the start of varibles you are passing to the website. These variables take the form of: NAME = VALUE, and are strung together by ampersands.

Say I do a search on Yahoo for "expectoration." I find the location of the search results is:
http://search.yahoo.com/search?fr=fp-pull-web-t&p=expectoration
And notice there are two values being passed through the URL string:
CODE

Name                           Value
fr                               fp-pull-web-t
p                               expectoration


The variable named 'p' was my search query. So now, on my webpage, if I wanted to include a search form to yahoo, I would just have to pass these values. the variable 'FR' is probably not even needed, but I'll include it just for explainations sake.

CODE

<FORM ACTION="http://search.yahoo.com/search" METHOD="GET">
   <INPUT TYPE="hidden" NAME="fr" VALUE="fp-pull-web-t">
   <INPUT TYPE="text" NAME="p" SIZE="20">
   <INPUT TYPE="submit" NAME="submit" VALUE="Search Yahoo">
</FORM>


When the form's method is specified as a GET value, the INPUTs are passed in the URL string (after the question mark). When METHOD is "POST", the variables are hidden to the string, but handled by the browser.

If you want me to explain anymore of this, just ask. I'll try to make it more clear.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.