Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Platinum Edition Using HTML 4, XML, and Java 1.2
(Publisher: Macmillan Computer Publishing)
Author(s): Eric Ladd
ISBN: 078971759x
Publication Date: 11/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Listing 31.4 shows a generic form for invoking AltaVista’s gigantic search engine. Listing 31.5 shows a modification to restrict the search to one of several predefined terms. Notice how Listing 31.5 takes the same form fields defined in Listing 31.4 and hard-codes some of them. The result is that Listing 31.5 always searches the newsgroups, and only for CGI by Example, Using CGI, or Que Corporation.


NOTE:  HTML examples are not provided for the other sites. The concept is the same for each site: You take the HTML used by the site itself to invoke its CGI script, and then modify the HTML to suit your needs.

Listing 31.4 A Generic AltaVista Search Form


<H1>Search AltaVista</H1>
<FORM METHOD=get
        ACTION=”http://www.altavista.digital.com/cgi-bin/query”>
<INPUT TYPE=hidden name=pg value=q>
<B>Search
<SELECT name=what>
<OPTION value=web  SELECTED>the Web
<OPTION value=news >Usenet
</SELECT>
and Display the Results
<SELECT name=fmt>
<OPTION value=”.” SELECTED>in Standard Form
<OPTION value=c >in Compact Form
<OPTION value=d >in Detailed Form
</SELECT></B>
<input TYPE=text name=q size=55 maxlength=200 value=””>
<INPUT TYPE=submit value=Submit>
<BR>
</FORM>

Listing 31.5 A Customized AltaVista Search Form


<H1>Search AltaVista</H1>
<FORM METHOD=get
        ACTION=”http://www.altavista.digital.com/cgi-bin/query”>
<INPUT TYPE=hidden name=pg value=q>
<INPUT TYPE=hidden name=what value=news>
<INPUT TYPE=hidden name=fmt value=d>
<B>Search Newsgroups for</B>
<SELECT name=q>
<OPTION>CGI by Example
<OPTION>Using CGI
<OPTION>Que Corporation
</SELECT><BR>
<INPUT TYPE=submit value=Submit>
<BR>
</FORM>

Because of a particular feature available on AltaVista and few other indexes, you can effectively use it as a local search engine to search out information on your own site.

One of the advanced keywords available on AltaVista is the host: keyword. You use this keyword to limit AltaVista’s search to only those hosts you specify. Assume, for example, that you want to limit the search to your site and that your site has been visited and fully indexed by the AltaVista robot. To narrow a search, first specify host:www.yoursite.com and then follow it with the search terms you desire. AltaVista produces a list of files on your site that contains the search terms. To find pages on the following site that concern merchandising, use this query:

host:acnielsen.com merchandising

Thus, you could modify Listing 31.5 to look like Listing 31.6.

Listing 31.6 A Customized Form to Use AltaVista to Search Your Site


<FORM METHOD=get
        ACTION=”http://www.altavista.digital.com/cgi-bin/query”>
<INPUT TYPE=hidden name=pg value=q>
<INPUT TYPE=hidden name=what value=web>
<INPUT TYPE=hidden name=fmt value=d>

<B>Search Our Site for</B>
<SELECT name=q>
<OPTION VALUE=”host:www.mcp.com ‘CGI by Example’”>CGI by Example
<OPTION VALUE=”host:www.mcp.com ‘Using CGI’”>Using CGI
<OPTION VALUE=”host:www.mcp.com ‘Que Corporation’”>Que Corporation
</SELECT><BR>
<INPUT TYPE=submit value=Submit>
<BR>
</FORM>

Note the use in this example of the VALUE keyword of the OPTION tag to specify the host and the search terms. If you want to enable freeform searching, you must write a CGI program that adds the host keyword before submitting the query to the search engine.

The HotBot (www.hotbot.com) and InfoSeek search engines also enable you to specify a particular site to search.

Using Lycos Search Resources

You can get HTML that links to Lycos by email. Lycos will even provide a link back to your site on the resulting search page.

Stop by http://www.lycos.com/lycosinc/backlink.html and fill out the online form. Within a day or so, you will get back some sample HTML. Lycos provides you with an identifying number so that when users search with Lycos from your site, the resulting search page contains an image you provide and a link back to your site.

Lycos is available at the following site:

http://www.lycos.com/

Linking to Starting Point

For many users, Starting Point is the starting point when they conduct Web searches.

When you visit Starting Point, you can add a link for your site at the following address:

http://www.stpt.com/general/setup.html#WEBPAGE

You can find the Starting Point main page at the following site:

http://www.stpt.com/

Linking to Infoseek

Infoseek makes it easy to add a link to its service to your site. Just go to the following site and follow the instructions:

http://www.infoseek.com/webkit?pg=webkit.html&sv=A2

You can find the main Infoseek page at the following site:

http://www.infoseek.com/

Using Excite on Your Site

Excite is more than a public index. Excite makes search engines that you can install on your own system, and it is working closely with Web server companies to provide integrated solutions. See the section “Implementing an Indexing Search Engine with Excite for Web Servers” later in this chapter for more information.

You can find the Excite Web site at the following address:

http://www.excite.com/

Using Other Search Engines

You can find dozens of other search engines on the Web—too many to hope to list them all. Each has its own advantages and disadvantages. “Meta” search engines, such as MetaCrawler, All4one, MetaFind, and 1Blink will even submit your query to several other search engines and collate the results.

The following listing identifies other important search engines. You can find a comprehensive list at http://www.albany.net/allinone/all1www.html#WWW.

Yahoo! Lycos’A2Z Go2.com
HotBot Open Text WebCrawler
WWW Yellow Pages Thunderstone What U Seek
PlanetSearch Magellan All4one

Using Web Servers’ Built-In Search Tools

Another alternative to implementing your own search engine is to use search services already built in to your Web server. Several Web servers for UNIX and Windows NT include built-in utilities to index and search the files at a site. Some of these tools have fewer capabilities than the search engines previously mentioned.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.