Understanding $_GET [#38] Code Dynamic Websites With PHP

Lecture 38: Understanding $_GET

When the URL the browser requests includes a query string (anything after a question mark), the $_GET collection is created automatically. The string on the left side of an equals sign ( = ) becomes a variable name, and the thing on the right side of the equals sign becomes that variable's value.

So, for example: in our previous lecture we have a link on our page that navigates to "?item=mexican-barbacoa". That URL will navigate to the template (which we have not created yet) and the $_GET collection will create a variable called "item" with the value of "mexican-barbacoa". We can then use that value to do something specific on our template.

It could be as simple as "echo mexican-barbacoa" or, "display specific information in an array with the key of 'mexican-barbacoa'" This is what we will be doing in our next lecture.


Похожее видео:

Get In Php learnWebCoding | 1.107
Unknown |
Gravity Visualized apbiolghs | 53.910.755