So we're going to talk about forms. If you recall, our previous lecture was functions and that's because forms follow functions in my syllabus. Get it? Forms follow functions. So at the end we talked the arrays, we talked about the super global variables and part of the goal is, is you're going to process HTML requests. And PHP is designed for that purpose, it's not a general purpose programming language, it's a programming language for web applications. And we use these arrays, $_GET, $_POST etc., and so that's how these things work. So just to review, if we put parameters on the end of a URL, ?x=2&y=4. The question mark is for the first one. And ampersand is for the following one. These are parsed and placed into an array inside your application called GET. And so you don't have to do anything. PHP magically does this before your program starts up, right? So you click a button or you type that URL into your browser, it gets sent using HTTP, Apache and PHP, parse that and set this global variable and then start your program up. The very first line of code, so this variable exists and it's called a super global inside of PHP and that's in your main code in any functions that you have within your main code. And so that's the basic idea of taking data from the outside world, key value data from the outside world, using the HTTP protocol, and getting it into you. Now, there is a more convenient way to enter data in, and that's what we're talking about now, and that is using forms. And I'll be honest, I'll just sort of step back in time a little bit. This would have to be like, mid-1994. And there was a time in '93 that there was this thing called Gopher. And Gopher was sort of more impressive to most of us than the web was. And the web was like, eh. And so I'm like, eh, the web, that's just another version of Gopher that's not any different. And the first time that I knew that the web was cooler than Gopher was when I saw my first form and I'm like wait a second, now we can actually type data and hit the Submit button. And the first form I saw was from FedEx.com and it was pretty much as simple as this and it just said enter the tracking number, you click a button and then it went into the tracking database and showed the tracking information. Early days of the web, really simple user interface but I'm like [SOUND] mind blown. And of course, you don't care. The web's here. Forms are a thing we do. We log in with them, we search with them, we do all kinds of things with them. And so this is the basic mechanism of creating a screen that's not just a screen for you to read, but a screen for you to put things in, and then submit that data. And this is sort of the simplest version of that thing we've got. So just HTML, it's not PHP. So we have a paragraph tag, and we have a form tag that says these things are grouped together. So these things are submitted together as a group. You have a series of input tags, dot, dot, dot, dot, and you have some text. Input guess is just some text. And then you say this draw, a little fill in the blank, and you can set how long it is, etcetera, etcetera. Put a previous version in there if you want. And you are giving a name, which is the name that is going to be used to submit this to the server. And then you have a button that basically takes this entire form and if there are more things in here, and you hit the Submit button, and it gathers up all the data from all these things. Then sends it to the server using a GET request in this case. We'll show how a POST request works in a second. And so, we type all this stuff in, we have the form, we type in the 12 and then we hit the Submit button. And then that paste sends in a key value pair which it pulls from this name guess and this number 12. And so then that sends that in. And of course when this code runs, $_ GET subquote guess quote is where that data ends up. And so the user doesn't have to type input on that form, okay? And so that's the idea, as you're constructing with the form a set of data that you would like to be submitted along with the URL. And so if we write a little bit of code here, we would basically have a paragraph tag and then a pre tag and then we print out the $_GET, right? And so the first time this runs, $_GET will be empty. It's there but it'll have nothing in it. And then we you actually send it the second time, when you type your 12, and then submit, it'll run it, and then the second time $_GET will have a 12 in it. So the first time through, it doesn't have any data, meaning there's nothing on here and then you hit the 12 and hit Submit and the second time through you're going to see data. So you know inside of your PHP code, this is in the server now, inside your PHP code you know whether or not there was a parameter there. Whether or not that's got some input data. So next we'll talk a little bit more about how we can use other kinds of things that we do with forms and different ways of submitting that data to the server.