?QuerystringWhat is a Querystring? Glad you asked. Ok, maybe you didn't but anyway - here goes...In World Wide Web, a query string is the part of a Uniform Resource Locator (URL) that contains data to be passed to web applications such as CGI programs.
|
|
So what does that mumbo jumbo mean Jack? Well, glad you asked. The querystring is our friend. Yep, he's just like the long lost friend from your childhood. He keeps you out to play long past when you're ready to come home. But he's there to help you find your way back. He can guide you and direct you back to the place where you started, or just tell you relevant information on the page you're currently viewing.
Just like the sound of you mom calling you home for dinner, the querystring can help you find your way back (via a Bread Crumb Trail).
The querystring is made up of TAG/VALUE pairs. Inside a URL, the ? is the separator. So you might see /?Tag=Value. Also, multiple Tag/Values can be on a single URL or Querystring. These Tag/Values are separated by an &.
Everyday you see them (querystring's that is), Maybe it's on Facebook (http://www.facebook.com/?ref=home) - that's telling us that the 'refering source' of this request was "home")....
...or maybe it was on Google today that you saw a query string and didn't know what it was: http://www.google.com/#hl=en&source=hp&q=olympics - (That's saying someone went to Google.com - typed in "Olympics" into the search box from the Google home page. How do you know? I'll show you...
Well, we see 2 things in the request above (in the querystring, there are tag/value pairs):
1. source=hp (the first tag we see is "source"; it's the source of the search in this case - "hp" or homepage in this example)
2. q=olympics (the second tag we see is "q" - or query... this is what the user was looking for - query = olympics in this case.
Tag/Value pairs can be anything. Yep, that's right. Anything (that's text that is) - No images or videos in a URL, only text.
What's amazing about this little champ is that he can transfer lots of information. From page to page to page, he can be used. And even if you never knew what he was there for, now you will.
To see another example, let's say you're searching for a new car. You pick 'Honda', then 'Pilot', then click search. The little breadcrumb trail (powered by querystring variables) is at the top of the page can now be displayed to you all because of our friend the querystring.
http://www.cars.com/go/search/newBuyIndex.jsp?stkTyp=N&AmbMkNm=Honda&AmbMdNm=Pilot&AmbMkId=20017&AmbMdId=21729&cpo=&mkId=20017&mdId=21729&minp=0&prMx=&rd=30&zc=90210&alMkId=20017&alMdId=21729
Notice this bit in the Honda Pilot page above:
&AmbMkNm=Honda
&AmbMdNm=Pilot
Full Wikipedia Defs of a Querystring | Like this Querystring write up? Give me some Link Love |