Internet
Fact-checked

At EasyTechJunkie, we're committed to delivering accurate, trustworthy information. Our expert-authored content is rigorously fact-checked and sourced from credible authorities. Discover how we uphold the highest standards in providing you with reliable knowledge.

Learn more...

What is a Querystring?

Derek Schauland
Derek Schauland

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

A querystring might be used to search for malted milk balls.
A querystring might be used to search for malted milk balls.

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).

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.

A querystring can be seen at the end of a URL in an address bar.
A querystring can be seen at the end of a URL in an address bar.

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.

Discuss this Article

Post your comments
Login:
Forgot password?
Register:
    • A querystring might be used to search for malted milk balls.
      By: kellyschulz
      A querystring might be used to search for malted milk balls.
    • A querystring can be seen at the end of a URL in an address bar.
      By: jamdesign
      A querystring can be seen at the end of a URL in an address bar.