 Today we're going to be looking at PHP and we're going to start looking at form submits This is something very important if you're going to be doing web design You're going to want to be able to have users submit information or at least retrieve information from their actions And today we're going to be creating a script that does a basic Get form submit so there's two basic types of form submits There's post and get the get type you may have noticed certain Websites like if you were to do a Google search Put the form submits in the URL And this is nice and easy for some things and there's also post which kind of it's a little more hidden in some ways I mean it's still viewable to the end user But the URL doesn't get all long and Discombobulated so it all depends on what you're trying to do for most people the get seems to be a little more Basics we're going to start with that, but we're going to do be doing some post stuff here soon so I'm going to use Vim as my text editor as always, but feel free to use whatever text editor you prefer I'm going to call this get dot PHP I'll hit enter and I will start my PHP script. I'm going to do PHP and Basically The way we check this is we're going to go let's say we want to get the user name Let's create a new variable user So dollar sign user equals and then we're going to say dollar sign underscore get this means we're looking at any submits that were get submits and Then some braces and then we're going to say in here inside single quotes user So this is looking at all the stuff that was submitted as as a get form submit and looking for the one that is labeled user Don't forget to put our semi-colon at the end here. So now we've got a variable called user and That's going to be whatever the input was. So we'll just echo out echo hello Dollar sign user So let's go ahead and save that up here. I'm in the directory with all my PHP scripts We've been using in our tutorials here I'm going to hit f5 and you need to refresh and you'll see that we have a get here get PHP now If I just click on that we get an error No, I'm sure line three Okay, it's just saying that I didn't that I haven't given it the the user yet So up here as this area error if you have errors set to show which I do because I find it easier to troubleshoot It's saying hello, but there is no user set so up here in our URL. I'm going to say question mark user equals Metal X 1,000 that would be me and if I hit enter now We get hello metal X 1000 if I was to put up here Bob we got hello Bob so You can do that. We can also have other things we can say what else do we want? We'll just say phone So let's say you're trying to get the input of a phone number. We're going to say get once again braces and we're going to say phone and in here we can put the output the echo output that we do with PHP once again is HTML codes so if I put a line break there with a tag for BR for for line break We are going to then say echo Oops number is dollar sign phone Get our semicolon there We'll save that if we were to run this by just refreshing up here We're going to get an error that phone is not set so here It tells you right here on line for that the there's an undefined index of phones So line for if you're in Vim you can see down here. It shows what line number you're at So let's go ahead if you have more than one Variable you're inputting you're just going to separate them by the ampersand the end symbol so and Phone equals we'll say 555-555-5555 And we'll hit enter and it says right here Hello Bob your number is and it's in my case It's it's highlighted as a link and that's because I have the Google talk plug-in So I can click on phone numbers and call it but Most time that would just show up as regular text right there. So just ignore the fact that this is underlying in blue That's a plug-in. I have my browser. I should have went into incognito mode. Anyway So that's a first look at that obviously your users are not going to be putting in the the information up here That's something you can do with a basic URL Link if that's the case if you've generated dynamically code on another page or You can actually create a form for them to fill out, which is what we're going to do in our next tutorial So I hope you enjoyed this You doing this makes it very easy to get and retrieve Information or submit information and retrieve the the output of that from a website Especially if you're just using something like W get although I mean using post and W get is not that hard at all But for some people who are new to it, I know when I first started out Get submit were a lot simpler to work out in my mind It's like well I just put it all in the URL and as W get this URL with the with the variables I place in it So I Hope you enjoy this tutorial. I've got a lot more coming with PHP once we get all these form submit stuff Then we're going to be doing some real cool stuff with javascript j query quickly retrieving a bunch of information to search through stuff Different ways of doing that and just once again. This is basically this entire year I started at the beginning of this year around the beginning of this year of making applications based on HTML as the HTML and CSS as the user interface and then using javascript as a client-side scripts and and PHP as a server-side script, although one of the great things about making web-based applications is Well, there's lots of great things One it runs on pretty much everything without needing to install anything because Pretty much everything has a current web browser on it When you're talking about server-side scripts if you actually have a server your server-side scripts I'm using PHP, but you can use anything you want you can write stuff in C if you want or C plus plus It's not really a practical, but if that's what you're good at you could do that. You can write them in Java You can write them in bash Python pearl. I'm just picking PHP because I like it. That's just personal preference And as far as client-side, I mean, there are little tweaks here and there You might have to do a javascript to get them to work in all browsers But the majority of stuff it just works and if you're you can always make these things standalone Applications if you don't have the server-side or they can even server-side to communicate or sorry client-side that Communicate with the server-side you you can package these into applications, which I've mentioned That's what we're getting to once we get all this down. We're gonna learn multiple ways to package stuff That are either cross-platform so you can create an application that will run on Windows Mac Linux Without having to recompile Or or iPhone or Android? I mean, I don't I don't use You know Windows myself really iPhone or Mac OS, but when you write a program in any language Well, not any language because some languages really suck, but when you write a program in a good language Should be cross compatible with all platforms in most cases unless you're getting very low level and Doing it this way just makes it easier And you'll see as as I'm talking, you know in some cases you'll be able to just create it and it'll just run everything Other than that you might have to package it different That's the big thing People think that you write a program and it's and I'm kind of going off on stuff now But you'll see as we get further into this that you write a program and it's only good for the operating system Right for and then you might have to rewrite it for another operating system And once again, that's not really true in most cases You write the program right once and you write it right you write it correctly you write it properly You write it. Well, it should run on everything. It's just a matter of packaging it for different systems Whether it's compiled or just packaging it and in some sort of wrapper Mainly because of Gooey displays are different on different machines. That's really the big point. Anyway, I babbled enough I just wanted to give you an idea of where we're going I think you're really going to enjoy this if you're looking to build programs And if you're hoping to do them properly to where they'll run on anything and I'm just using HTML and CSS as a front-end because that's the easiest but That's not necessary like Cute is now ported to both Android and iPhone from what I've read so you can package stuff You can write something in cute In have it run on Windows Mac Linux Android and iPhone pretty much as they are Just have to package it as an APK file or whatever an iPhone Package file is but the program itself would stay basically say anyway I'm babbling and babbling and babbling. I just really hope that you're excited about this stuff that I've got coming up Because I know I'm excited about it. I've been Working with this stuff for a while now and I'm just trying to share what I've learned Anyway, visit films by Chris calm. That's Chris with the K. There should be a link in the description check that out and definitely if you're enjoying these PHP and and Also, you know all the web-based tutorials I'm doing definitely give this video a thumbs up like it and comment below and if you have any questions Please go to films by Chris calm. That's Chris of the K Again links in the description go to social network click on IRC and there's the IRC channel where you can talk to me and other People who hopefully can help you try not to ask technical questions in the YouTube comments Thank you again for watching and have a great day