To read the article online, visit

Search the Internet from your site!
By Christopher Miller

A quick and easy way to add interactivity to your site is to allow your visitors to search the Internet. You can add any search engine to your site as long as they use a query string, here's how.

  • /four_guys/article_four/web_search.asp" target="other">Click here for an example

    The first thing you want to do is go to your favorite search engines and grab their query string. You can grab it by simply doping a search. Below is a list of the major search engines and the query strings they use:


    The next thing you want to do is to create your page. Lets start with a simple form, a select box, text box, and submit button. The select box will be used for the search engines, and the text box will be used for the search words.

    <form action="web_search.asp" method="post">
     <select name="selEngines">
      <option value="yahoo">Yahoo</option>
      <option value="altavista">Alta Vista</option>
      <option value="excite">Excite</option>
      <option value="hotbot">Hotbot</option>
      <option value="lycos">Lycos</option>
      <option value="msn">MSN</option>
      <option value="webcrawler">Webcrawler</option>
      <option value="go">Go</option>
     <input type="text" name="txtSearchWords" size="30">
     <input type="submit" name="btnSearch" value="Search">

    When I listed the search engines' querystrings, notice how I marked the "SEARCHWORDS" in blue. This is where we want to place the input from our text box strSearchWords. All you need to do is create a simple If...Then statement with a Response.Redirect that goes to the correct search engine, like I've shown below:

    If Request.Form("selEngines") = "yahoo" Then
       Response.Redirect("" & _
    End If

    Do this for all of the search engines and your all done! (See the code for web_search.asp.)

    In /four_guys/article_four/web_search.asp" target="other">the example I also show you how to achieve the same result with radio buttons. You can even go a step further and do check boxes that will allow you to search multiple engines opening a new window for each one!


    Christopher Miller


  • Viewe the code for web_search.asp (text format)
  • /four_guys/article_four/web_search.asp" target="other">View this script in action!

  • Article Information
    Article Title: Search the Internet from your site!
    Article Author: Christopher Miller
    Published Date: Sunday, June 06, 1999
    Article URL:

    Copyright 2019 QuinStreet Inc. All Rights Reserved.
    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers