Passing variables in the URL

We need a way of gathering input from the user and passing this to a web page so as to display different results according to input from the user. There are two ways of passing variables from one page to another in PHP – either with the variable name and value appearing in the URL or not.

In this lesson we learn how to pass variables and their values in the URL using the PHP superglobal$_GET.