Understanding $_GET 
Understanding $_GET
by Brad Hussey
Video Lecture 38 of 45
Not yet rated
Views: 843
Date Added: May 14, 2017

Lecture Description

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 menu.php page that navigates to "dish.php?item=mexican-barbacoa". That URL will navigate to the dish.php 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 dish.php 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.

DOWNLOAD COURSE FILES HERE
www.bradhussey.ca/download-php-course

Course Index

Course Description

This course is a Total Beginner's Guide to Coding Your Very Own Dynamic Websites with PHP, so you need no prior knowledge or experience — although it's a good idea that you know some HTML (my beginner's guide "Build a Website from Scratch with HTML & CSS" will get teach you everything you need to know).

So — why learn PHP? Well, PHP is a very powerful scripting language used by millions of websites. Some of the most popular websites and frameworks utilize PHP to build their dynamic websites. PHP works very well with HTML, and therefore will allow you to start coding dynamic websites quickly without having to learn some of the more complicated scripting languages out there.

Comments

There are no comments. Be the first to post one.
  Post comment as a guest user.
Click to login or register:
Your name:
Your email:
(will not appear)
Your comment:
(max. 1000 characters)
Are you human? (Sorry)