Adding Google Free WebSearch

Lots of webmasters add Google search boxes to their sites, because Google makes it easy to do so. Google’s main program is called Google Free, and it comes in several different flavors—basic web search, web search with SafeSearch filtering, and web search with site search added.

Adding a Basic Search Box for Web Searches

The first of these options is Google Free WebSearch. It’s easy to add; all you have to do is insert the following HTML code into your web page’s code, where you want the search box to appear.

Here’s the code:

<!-- Search Google -->
<center>
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<TABLE bgcolor="#FFFFFF"><tr><td>
<A HREF="http://www.google.com/">
<IMG SRC="http://www.google.com/logos/Logo_40wht.gif"
border="0" ALT="Google" align="absmiddle"></A>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="Google Search">
</td></tr></TABLE>
</FORM>
</center>
<!-- Search Google -->


The result is a standard Google search box, like the one shown in Figure 41.1.

Figure 41.1. Adding a Google search box to your web page.

Adding a Google search box to your web page.

Adding a SafeSearch Search Box

If you want your visitors to be protected against unwanted adult content when they search Google from your site, you can add a Google search box with the SafeSearch content filter enabled. To add a Google Free SafeSearch box to your site, use the following HTML code:

<!-- Google SafeSearch  -->
<center>
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<TABLE bgcolor="#FFFFFF"><tr><td>
<A HREF="http://www.google.com/search?safe=vss">
<IMG SRC="http://www.google.com/logos/Google_Safe.gif"
 border="0" ALT="Google" width="115" height="45" align="absmiddle"></A>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=hidden name=safe value=strict>
<INPUT type=submit name=sa value="Google Search">
</td></tr></TABLE>
</FORM>
</center>
<!-- Google SafeSearch -->


This adds the search box shown in Figure 41.2 to your page, where you inserted the code. (Notice the “SafeSearch” logo is added to the Google logo.)

Figure 41.2. Adding a Google search box with SafeSearch to your web page.

Adding a Google search box with SafeSearch to your web page.

Adding a Box to Search Your Own Site

Google also lets you search your own website using Google’s search technology. This option is dubbed Google Free WebSearch with SiteSearch; just insert the following HTML code:

<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<TABLE bgcolor="#FFFFFF"><tr><td>
<A HREF="http://www.google.com/">
<IMG SRC="http://www.google.com/logos/Logo_40wht.gif"

border="0" ALT="Google"></A>
</td>
<td>
<INPUT TYPE=text name=q size=31 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="Google Search">
<font size=-1>
<input type=hidden name=domains value="YOURDOMAIN"><br><input type=radio
name=sitesearch value=""> Web <input type=radio name=sitesearch
value="YOURDOMAIN" checked> This Site <br>
</font>
</td></tr></TABLE>
</FORM>
<!-- SiteSearch Google -->


For this option, you need to replace the two instances of YOURDOMAIN with your own domain name (either with or without the leading www). As you can see in Figure 41.3, this inserts a search box with the option of searching the Web or your own website.

Figure 41.3. Adding a Google search box with both web and site search to your web page.

Adding a Google search box with both web and site search to your web page.

Adding a Custom Search Engine to Your Site

Here’s another cool option for adding search to your site. Google Custom Search Engine, as the name implies, is a custom search engine you can add to your site. With Google Custom Search Engine, you can specify which sites you want to include in your searches, customize the look and feel of the search and results pages to match your website, invite your site visitors to contribute to your search engine, and make money from ads placed on the search results page. And it’s all a matter of filling in some simple web forms.

Creating Your Custom Search Engine

Google lets you create as many custom search engines as you like. To create a new one, go to www.google.com/coop/cse/ and click the Create a Custom Search Engine button. When the next page appears, as shown in Figure 41.4, make the following choices:

Figure 41.4. Creating a custom search engine.

Creating a custom search engine.
  • Search engine name. This is the name that appears on your search engine page.

  • Search engine description. This is a short description of what your search engine is searching for.

  • Search engine keywords. These are primary queries that help to define the focus of your search engine.

  • Search engine language. Choose from available Google languages for your search and results pages.

  • What do you want to search? This is important; you can choose to search the entire Web, only sites you select, or the entire Web emphasizing the sites you select.

  • Select some sites. This refers to websites that you want your search engine to always search. (You can include your own site in this list.)

  • Select an edition. Select the Standard edition (free, but displays ads on the results pages) or Business edition (doesn’t display ads on results pages, but costs $100/year).

Agree to the Terms of Service; then click the Next button, where you can try out your new search engine. If you like the results, click the Finish button. This displays your Custom Search Engine console.

To customize the look and feel of your search engine, click the Control Panel link for that search engine. When the next page appears, click the Look and Feel link. This displays the page shown in Figure 41.5; from here, you can add a logo or other image, as well as customize the page colors. After you’ve saved your changes, you can view how your search engine looks by returning to the main control panel and clicking the Homepage link for that search engine.

Figure 41.5. Customizing the look and feel of your search engine.

Customizing the look and feel of your search engine.

Adding the Search Engine to Your Website

To add your new search engine to your website, click the Control Panel link for that search engine and select the Code link. When the next page appears, select your hosting options (on Google’s website or your own site); then copy the HTML code displayed on this page into the HTML code for your web page. (You’ll need to copy the code into each page where you want the search box to appear.) After the code is inserted (and you’ve saved your HTML page), a search box is displayed on your page.

When a visitor enters a query into your custom search box, Google serves up a page of custom results. By default, this page is hosted on the Google site but conforms to the look and feel (and the custom results) you specified.

Tip

To generate some cash from the AdSense ads placed on your custom search results page, click the Make Money link and follow the onscreen instructions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.57.172