WEBVTT

0
00:09.660 --> 00:10.740
What can I say?

1
00:10.770 --> 00:14.040
But well done for sticking with me through this entire course.

2
00:15.160 --> 00:16.540
We've pretty much reached ...

3
00:16.840 --> 00:21.730
I know ðŸ™ˆ ... I hate even saying it, but we've pretty much reached our last section in this course.

4
00:21.730 --> 00:23.590
But let's cheer up, because we have learnt a lot.

5
00:23.620 --> 00:25.270
It's been a super, super fun time.

6
00:25.270 --> 00:29.710
And in this last section I do want to touch on a bit of server-side processing.

7
00:29.830 --> 00:36.160
I know this course is majority focused on client side validation and building forms on the client side.

8
00:36.430 --> 00:39.310
I just don't have enough time in this course to teach you about servers.

9
00:39.310 --> 00:45.070
Servers are a whole topic in and of itself, but I thought it wouldn't be complete if I didn't at least

10
00:45.070 --> 00:46.670
touch about it and talk about it.

11
00:46.690 --> 00:50.680
So when we go and submit a form, that data has to be submitted somewhere.

12
00:50.680 --> 00:55.510
And we've spoken about client side validation that you need to perform checks on the front end because

13
00:55.510 --> 01:00.250
it increases performance, it improves performance and improves UI.

14
01:00.340 --> 01:00.700
Right, 

15
01:00.700 --> 01:02.380
you don't want the user to submit a form,

16
01:02.380 --> 01:03.220
it goes to the server.

17
01:03.250 --> 01:06.070
The server then says, "Hey, there's an error" and sends it back to the user.

18
01:06.100 --> 01:07.090
You don't,

19
01:07.120 --> 01:09.030
well, you want to try and avoid that if you can.

20
01:09.040 --> 01:12.910
But, as I keep mentioning, front side validation is not enough.

21
01:12.940 --> 01:19.580
You do need more, and you need to also ensure that your server side code checks the data.

22
01:19.580 --> 01:22.340
But again, that's a topic that's beyond the scope of this course.

23
01:22.340 --> 01:27.500
But what I do want to show you is that I want to show you that there are different ways to submit form

24
01:27.500 --> 01:28.460
data to a server.

25
01:28.460 --> 01:30.830
And I keep saying you can use the form wrapper, right?

26
01:30.830 --> 01:33.860
We can put the method attribute on there, a GET or POST request.

27
01:33.980 --> 01:39.710
We can put the action attribute, and that defines where the data is being sent to. And then your server listens

28
01:39.710 --> 01:42.370
on that URL for that request, and processes the data.

29
01:42.380 --> 01:46.610
But there's another way ... and the other way to submit form data is via AJAX.

30
01:46.640 --> 01:48.950
Don't be intimidated by all these fancy words.

31
01:48.980 --> 01:52.150
AJAX just means Asynchronous JavaScript and XML.

32
01:52.160 --> 01:55.190
So what I want to do in this section is I want to talk about these things a bit more.

33
01:55.190 --> 01:58.850
I want to show you examples of using AJAX.

34
01:59.270 --> 02:05.360
I want to show you an example as well of creating a PHP server and actually submitting data to a server,

35
02:05.360 --> 02:08.750
that server listening for the data, and then displaying something back.

36
02:08.750 --> 02:10.730
But I'm not going to only give you a PHP example.

37
02:10.730 --> 02:14.120
I'll also start up a Node.js server, I'll show you how that works.

38
02:14.120 --> 02:15.980
So, it will be an interesting section.

39
02:15.980 --> 02:20.690
It's not going to be super long, it's not going to be super detailed, but it should give you enough

40
02:20.690 --> 02:25.100
so you can get started yourself on more complicated server side processing.

41
02:25.400 --> 02:26.200
But enough said.

42
02:26.210 --> 02:28.130
I'm just talking and talking and talking.

43
02:28.130 --> 02:31.760
So let's jump into the very first lecture in this section.

44
02:31.760 --> 02:32.600
I can't wait.