WEBVTT

00:00.920 --> 00:04.400
I'll call you back again to another video lecture in PHP.

00:04.610 --> 00:10.190
In this video lecture we go ahead and look at git and post in PHP.

00:17.630 --> 00:19.190
All right so we'll try this course.

00:19.190 --> 00:26.210
We have been looking at Getmethod and how we can actually see that our index method, we always print

00:26.210 --> 00:26.900
our things.

00:26.900 --> 00:30.170
And in the URL that is always shown.

00:30.170 --> 00:33.800
And what if you are going to enter credit card numbers.

00:33.800 --> 00:35.480
You want to enter passwords.

00:35.510 --> 00:39.110
Are you going to allow these things to be shown on the URL.

00:39.110 --> 00:41.930
So that is the question of comes to mind as a developer.

00:41.930 --> 00:44.120
So how can you be able to hide these.

00:44.150 --> 00:47.420
That is import as of this video lecture.

00:47.450 --> 00:50.150
Now let's go ahead and create a form.

00:50.150 --> 00:52.160
And I'll go ahead and say form.

00:52.160 --> 00:55.040
And then go ahead and close my form.

00:55.940 --> 00:57.320
So that is closed.

00:57.320 --> 01:00.170
And then let's go here and give action.

01:00.170 --> 01:09.420
And we are still working with sites dot, p, h b and then we go ahead and give the method and let the

01:09.420 --> 01:11.850
method the equal to get.

01:11.850 --> 01:13.620
So we are going to start with get.

01:13.620 --> 01:18.270
And then I will show you how we can be able to correct this.

01:18.300 --> 01:19.740
Now let's go ahead and see.

01:19.740 --> 01:21.150
We have a password.

01:21.150 --> 01:23.640
And I just give a prompt password.

01:23.640 --> 01:32.940
And then we are going to have an input password and let it type be equal to password.

01:32.940 --> 01:38.370
And then let the name be equal to password.

01:38.400 --> 01:41.700
Then we go ahead and close this.

01:41.730 --> 01:42.330
All right.

01:42.360 --> 01:47.700
Now let's go ahead and put a brick so that this goes to another uh line.

01:47.730 --> 01:49.500
I'm going to shift this a little bit.

01:49.500 --> 01:54.000
So now let's go ahead and add a submit button.

01:54.000 --> 02:01.200
So input and uh let the type be equal to submit.

02:01.200 --> 02:03.050
And then we'll will go ahead and close this.

02:03.050 --> 02:05.270
So now we have to create a form.

02:05.270 --> 02:09.590
And if we go ahead and refresh this we can see we have this form right in here.

02:09.830 --> 02:10.370
All right.

02:10.370 --> 02:14.810
So let's go ahead and drag this a little bit because I want this to be all right.

02:14.810 --> 02:23.090
So I just okay let's remove the break so that this will go in one line because I just wanted it to go

02:23.090 --> 02:24.140
to the next line.

02:24.140 --> 02:24.740
All right.

02:24.740 --> 02:28.910
So I have this in one line and that is looks good and looks better.

02:28.940 --> 02:39.440
Now if I go over to PHP let's go to PHP and equal whatever we want and let's say dollar sign underscore

02:39.470 --> 02:40.280
get.

02:40.280 --> 02:49.970
And then we go ahead and pass password a rank ahead of semicolon at the end.

02:49.970 --> 02:53.000
And let's go ahead in here and inserted password.

02:53.000 --> 02:58.520
And I'm going to say that the password is going to be equal to.

02:58.550 --> 03:01.100
So right now you don't see what I put in.

03:01.100 --> 03:02.370
So for the client side.

03:02.370 --> 03:03.780
You know, whatever you do.

03:03.780 --> 03:10.740
And if I should go ahead and submit this password, and I click that twice, let's go ahead and do that

03:10.740 --> 03:11.250
again.

03:11.250 --> 03:13.110
So go ahead and submit this password.

03:13.140 --> 03:21.030
Now you can see I have my password showing up here and down here I have judge still.

03:21.030 --> 03:22.620
So this is the password I entered.

03:22.620 --> 03:26.220
And you can see I have password right in here.

03:26.280 --> 03:28.830
Password equal to judge still.

03:28.950 --> 03:34.950
So you can see that this is not really secured because on the URL parameter it can be able to see your

03:34.950 --> 03:35.430
password.

03:35.430 --> 03:40.920
And in case you put in a credit card number let's go ahead and say you put some credit card number and

03:40.950 --> 03:43.230
you submitted that to make payment.

03:43.230 --> 03:51.690
And it goes out there and show it means that on the history page, people can actually go to your history

03:51.690 --> 03:54.450
and pick whatever that is in there.

03:54.450 --> 04:01.800
So the major reason why we are doing this lecture is to find a way to be able to tackle this.

04:01.830 --> 04:04.190
We want to post the password right in here.

04:04.220 --> 04:04.910
But what?

04:04.910 --> 04:08.030
We don't want a password to be shown up here.

04:08.030 --> 04:10.310
So how can we be able to do this.

04:10.310 --> 04:12.710
So that is the question right now.

04:12.740 --> 04:17.660
So in order to solve this problem in PHP it is solvable.

04:17.660 --> 04:19.190
And it is very simple.

04:19.190 --> 04:24.020
So as a PHP developer we have what is called a post and get.

04:24.020 --> 04:30.560
So what we have been using throughout this course and before now or we have been using before now is

04:30.560 --> 04:32.570
the post is the Get method.

04:32.570 --> 04:36.650
So right now I'll go ahead and introduce you to the post method.

04:36.650 --> 04:41.480
So go over to method and remove the gate and type in post.

04:41.480 --> 04:48.050
So this single four letter words can be able to change this.

04:48.080 --> 04:55.160
For once you do this you go right in here under the PHP and change the get to post as well.

04:55.940 --> 04:58.160
And then we go ahead and save this.

04:58.190 --> 04:59.660
Let's refresh this.

04:59.660 --> 05:01.970
And uh that is gone.

05:01.970 --> 05:04.680
So now let's go ahead and type in this again.

05:04.680 --> 05:09.840
So I'll go back and insert the judge Steve, as the password.

05:10.080 --> 05:12.780
And uh, I don't know what I get it right.

05:12.780 --> 05:20.190
So let's go ahead and uh, do that again and let's go ahead and submit this so we can see I have Steve.

05:20.220 --> 05:22.680
Now check out the URL parameter.

05:22.710 --> 05:27.990
You can see that, uh, nothing is ever displayed there again.

05:28.020 --> 05:28.620
Wow.

05:28.620 --> 05:29.130
That is cool.

05:29.160 --> 05:29.670
Right.

05:29.670 --> 05:39.960
So truly, cause we learned, uh, about getmethod, and now we are learning about, uh, post method.

05:39.960 --> 05:47.700
And you can see that as a PHP developer Post method gives you more security than the Get method.

05:47.700 --> 05:53.220
So most of the things you'll be developing, we are going to be using the post method instead of the

05:53.250 --> 05:59.700
get method, because the get method will actually display that on the URL parameter, which is not actually

05:59.700 --> 06:00.090
good.

06:00.090 --> 06:01.500
So what can we do?

06:01.500 --> 06:03.650
Client side and the server suicide.

06:03.650 --> 06:12.020
In PHP, we always going to use the post method to be able to make things to be more secure and more

06:12.020 --> 06:22.100
better, and having a clean URL that doesn't have so many things on there so that whatever we collect,

06:22.130 --> 06:26.540
we actually just post it without just using the get, you understand?

06:26.540 --> 06:29.420
So we are going to use the Get method.

06:29.450 --> 06:33.860
And henceforth so can we use the post method.

06:33.890 --> 06:35.300
Henceforth in this class.

06:35.300 --> 06:37.730
So can be able to see how good it is.

06:37.730 --> 06:40.130
So go ahead and check it out.

06:40.160 --> 06:40.910
Practice with me.

06:40.940 --> 06:48.260
Try other things username the password or try to enter your login details and cool and it is better.

06:48.260 --> 06:52.370
We use the post method for this, so check it out and practice with it.

06:52.370 --> 06:57.410
And if you have any question, you go ahead and use the question and answer section.

06:57.410 --> 07:00.260
And I'm going to get back to you as soon as possible.

07:00.290 --> 07:01.340
Thank you so much.

07:01.340 --> 07:04.700
And I'm going to see you in the next video lecture.
