Category: 

What is a Querystring?

Article Details
  • Written By: Derek Schauland
  • Edited By: O. Wallace
  • Last Modified Date: 14 November 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
The mongoose was introduced to Hawaii in order to kill rats, but mongooses hunt in the day, while rats are nocturnal.  more...

December 7 ,  1941 :  Japanese bombers attack Pearl Harbor.  more...

The web browser has revolutionized computers and the information made available using them. Sometimes using a web browser is as simple as entering "www.somewebsite.com" into the address bar and pressing enter (or clicking the GO button). Many times this will take any computer user where they need to go and nothing further will be needed.

Other times, a web surfer may be visiting a search engine when the search query is entered and the web surfer clicks the search button the item in the address bar is no longer very friendly. Consider the following example:

To search for Malted Milk Balls on the Internet, using Google, the string "Malted Milk Balls" is entered and the search button is clicked.

The address bar changes when the results are returned to display the following:
http://www.google.com/search?hl=en&q=Malted+Milk+Balls&btnG=Search

The portion beyond the last forward slash (/) is referred to as a querystring. A querystring is a URL containing a list of variables which are passed to the web server to retrieve information. In the case of the example above, the querystring tells the web server at Google to search the database in english (hl=en) and query the database for Malted+Milk+Balls (q=Malted+Milk+Balls). The last variable passed is the button used to find the results (btnG=Search).

Ad

If the Google Search Button on the homepage had been clicked, the btnG= portion of the query string would have read something like btnG=Google+Search.

Querystrings may not seem all too useful, but they can assist in accessing applications from other pieces of code and allow the web page to be skipped. For example, some web pages now include their own Google search boxes. These boxes work the same as the one shown on Google.com by simply sending a query string with s= to the google search engine.

The use of query strings can also be used to create a search for a particular site or search engine in the search engine dialog of both Internet Explorer 7+ and Mozilla Firefox. These features in the browser allow any website with a search box to be used from the browser without visiting the actual search page. Query strings help make this possible.

One more way to use a querystring would be to enter http://www.google.com/search?q=fun+and+games into a browser address bar. The result should return results for fun and games. It passes the querystring "fun and games" to the search application at google.com.

A querysting is just another way to access applications on the Internet. Many times they may not be noticed, but other times they can allow additional access to web based services and databases.

Ad

You might also Like

Recommended

Discuss this Article

Post your comments

Post Anonymously

Login

username
password
forgot password?

Register

username
password
confirm
email