This post goes out to all of those people out there who have seen all of those numbers and letters jumbled up at the end of a URL that really do not make any sense. This is the query string, and it makes sense to web browsers! The query string always starts with a ? mark after the URL. After the question mark a query string has a parameter and value, e.g. color=Blue. This is a way for a link to call out to a web page that has .
Example:
http//scottlassiter.com/index.php?color=blue
This parameter will be sent through the query string and intercepted by a code within a web page that is usually hidden in the view source option. The web receiving web page has parameters that look for a certain parameter, e.g. color, and then parses what the value of that parameter is, e.g. blue.
So if I have a page that is looking for a Query String parameter of color=blue, then I may have a function to list all of the logos I have created that are classified as blue.
Each URL can have several parameters passed through the query string. To add another parameter, you add an ampersand & followed by the next parameter.
Example:
http//scottlassiter.com/index.php?color=blue&logo=3
This example would be calling for logo=3. In my code I could have a logo that is listed as 3, so that logo would show.
There are many ways to use the parameters and their values to extract specific data from a web page. Query strings give an easy way for links to communicate to websites to pull information. Next time you are on Facebook or twitter, check out the query string, it will show all kinds of interesting values. Some will look to make sense and others not. Hopefully this helps you understand the web a little more!