URLs
Each page has many variables present, even if you don't see them or declare them. These variables are grouped and placed in virtual buckets on the server and in memory. These "buckets" are called "scopes". There are several scopes we are going to use in this class but now we are just going to look at two of them: the URL scope and the FORM scope.

The URL Scope

Look at the URL of this page. It is http://127.0.0.1:64900/learnBoxLang/index.bxm?p=URLs. Have you ever looked at a URL and dissected it? The URL breaks down into several parts:

http:// - The protocol that is being used. Most websites use http:// or https://
127.0.0.1:64900 - This is the domain name (and is listed in the DNS records to point to this computer)
/learnBoxLang/index.bxm - This is the folder and file name of the page you are opening
?p=URLs - This part might be new. We are actually passing in named variables to the page which the page can then use for processing. In this case, whenever you click on a link on the left hand side, this same page is loading. However, based on the value of the "p" variable, different content loads. The "?" sign separates the page name from the variables or "query string" as it's called.
Exercise: Go To Amazon.com and click on any of the items. Look at the URL. Somewhere in there is a ? which separates the name of the page and the variables that the page uses to render accurately.

Each language stores and processes these variables differently. BoxLang stores them as a structure in a "bucket" called "URL". For example, if I use <bx:dump and type <bx:dump var="#url#" label="URL" />

URL - URL Scope: 1
p	
String: URLs
you'll see a structure of all of the URL or "GET" variables that are being passed to this page. Copy this starting and including the "&" sign: &name=Bob&lastname=Marley. Paste it into the address bar AFTER ?p=URLs so that it reads ?p=URLs&name=Bob&lastname=Marley and press Enter to load the page. See how the dump of the URL variables changed above? The & sign is used to separate one variable from another. the format is KEY=Value with no quotes.

Exercise #2:

In the exercises folder, create a new pages called ShowMe.bxm. Put some simple text in it like Hello!
Also in the exercises folder, open the file called toc.bxm. The entire page consists of links, each one pointing to one of the pages in the exercise folder. Follow the pattern and add a link to ShowMe.bxm.
Can you figure out how the content is appearing? In the exercises/index.bxm page there is a component which is displaying the other pages. What is it called?