Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: HTML Help (Read 2256 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

HTML Help

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?



HTML Help

Reply #3
Thanks, that exactly it.  Do you know how to do the same thing with Yahoo ???

 

HTML Help

Reply #4
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: [Select]
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: [Select]
<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.