 Okay, we've been working on form submits and PHP. We've been using the get method. Today we're going to move on to the post method. So the get method puts the information in the URL, which is handy sometimes. It can make things a little simpler, especially if you're maybe writing an application that interacts with a website. If that website uses a get form submit, sometimes it makes it easier because you just input the information into the URL. But lots of times I like using the post. It keeps the URL a little cleaner. But let's go ahead and have a look at that. So what I'm going to do is I'm going to say vim. I'll call this post.php. And this will be what we'll be submitting to. And we're going to create our PHP tags here. And I'm going to say, just like last time, I'll say dollar sign user. So we're creating a variable called user. And it's going to equal dollar sign. Last time we had dollar sign underscore get all capital. This time we're going to do post all capital. Because so that we're going to be looking at all of the submits that our post submits. And in particular, we're going to say here in these braces or brackets, we're going to say look for the post variable of user. We'll do the same thing, dollar sign, phone, just like we did last time. Equals dollar sign underscore post. And we're going to say phone. Then we're going to say echo. Hello. Or are we going to say, instead of, we'll just do a different message than the last time just to be a little different. We're going to say dollar sign user. I'll do an apostrophe. Yes, like this. I think so. Users phone number is dollar sign phone. So my column there. Okay. So real quick, we've got our PHP tags open and close saying everything between this is PHP script. And then we're going to create a variable called user. And what the user is going to be equal is any post submit that has the name of user. Same with phone. We're creating a variable called phone. Now, this doesn't necessarily have to match this. I can call this phone and this numb or the other way around. Because we're creating a whole new variable here that's just based on what we're passing it over here. And then we're just going to echo out users phone number is phone. In this case, whatever user and phone number we pass. So go ahead and I'll save that. And if we go back to here to my web server, you can see that we have a post PHP that we just created. So now, unlike the get form where we just put stuff in the URL, we're going to have to create some sort of form for this to submit to. So we're going to say vim. And we're going to say post dot html. And there are ways of doing this all in one file, which you may want to do occasionally. And I'll get into that in future tutorials. But just like any HTML file, we'll put the HTML tags in this particular case. If you didn't put the HTML tags in the body tags, and you just put the form, it would work. But this is a little more proper. So now we're going to say form. Close our form. And just like before, we're going to give it an action. So this part, everything in here is pretty much going to be the same as the get, except for one little thing. We're going to say action. And we're going to say the action is wherever we're sending this information, which we just said is our post PHP file. It's going to be in the same directory. So all we have to do is type post dot PHP. And we're going to have to give it a method. Method equals, in this case, last time we did get this time, we're going to do post. We're going to say input type equals text. And then we're going to say the name. And the name is how we know when we submit it, which variable is which. We're going to say user. And we're going to say input type equals, again, text. Name equals phone. And again, there's other types of inputs. And if you're doing a phone number, there's actually specific ones for numbers and and calendar dates and that sort of stuff. And we'll get into that in future tutorials. Input type equals submit. This is the basic way of submitting a form. Soon we're going to be getting to show you how to submit stuff through JavaScript so that you can maybe manipulate the information or check the information certain ways before submitting it, but also with with the HTML5 and the different types. If you set one to be a number and someone input something other than numbers, well, it would warn them when you go to submit that they need to fix that. Also, if you're on a mobile device, it brings up a special keyboard based on what type the input is, but that's something we'll get more into in future tutorials. So type and we'll give it a value, which is what the button is going to actually say. We'll just say submit in this case. I'm not going to worry about labeling them in this tutorial with a previous tutorial. That's just adding some tags, whatever format you want the information to be at. There's also placeholders that we'll get into in future tutorials, but that's once again future tutorials. So here's my post.html. I'm going to click that. I'm going to put in here Chris and over here I'm going to say 555-5512 and I'm going to click submit and it says Chris's phone number is 555-5512 and you can see our URL does not reflect any of that. So once again, all depending on what you're trying to accomplish, if you're trying to make that stuff, it's not really secret because any browser now has like a console window like this. I'll show you, I'm in Chrome. I hit F12 to bring up this console and I'll clear this out. If I click submit, you can see this post here. If I click on that, it tells you exactly what information was submitted and what and anyone can actually look at the HTML code by hitting Ctrl U and oh, Ctrl U on the form itself. Ctrl U and you can see what is what. So it's not really hidden. It's just, you know, someone who doesn't know any better it's definitely hidden, but it just makes your URL a little bit cleaner all depending on what you're trying to do. So that's it for this tutorial. We're going to get more into form submits using JavaScript and retrieving that information using, you know, maybe putting forms and the retrieving of the information instead of having an HTML file and a PHP file separate. Have it all in one PHP file. We're also beginning where we're going to be able to submit information and retrieve that the output without having to refresh the whole page and actually modify the current page we're in using JavaScript and although we're actually probably going to do more with jQuery because it definitely makes it simpler. So definitely look forward to that. I hope you're enjoying tutorials. Definitely let me know if you are. Comment below if you like these tutorials. Give them thumbs up. If you have technical questions that take more than a moment to answer anything more complex than one or two sentences, please visit my site filmsbychris.com. That's Chris with the K. Go up to the tab that says social network and down to IRC. At least that's how my site is now. A year from now it might change, but I do have an IRC channel on free note. It's pound films by Chris and I'm in there. There's other people in there. Don't come in there just to talk to me. Come in there to talk to everyone that's in there. I'm in there a little bit every day but not all the time. So and also try searching my videos and of course Google before you come and ask a question. A lot of the times when people ask me questions I tend to Google their question and the first link is their answer. So please Google before you ask. If you still can't figure out you know ask. Also search my videos on my website. I've tried to make it very simple for you to search through playlists and videos. So go ahead and check that out. I get asked questions quite a bit where I just search my own videos and give them a link to a video that I've already made where if they were just to search themselves they would have found it without my help. So I thank you for watching and I'm not trying to be rude there. I just I get a lot of questions. I also don't really check my YouTube comments on older videos. So so if you ask something I may not even see your question just because I just don't have enough hours and day. I have a lot of videos up and a lot of people asking questions but I thank you for watching. I try to help you when I can and I hope that you have a great day.