WEBVTT 00:00:07.080 --> 00:00:10.290 In this video you're going to get introduced to BHB. 00:00:10.740 --> 00:00:20.670 So what is BHB Ph.D. or hypertext preprocessor is a scripting language which runs on the server side 00:00:20.940 --> 00:00:22.860 all the backend. 00:00:23.810 --> 00:00:25.340 Let's have a look at this. 00:00:25.350 --> 00:00:31.510 Flowcharts and understand BHP in a simple way. 00:00:31.560 --> 00:00:40.670 So far we have been following the simple routes where the user sends a request to the server and he 00:00:40.800 --> 00:00:46.040 we have been requesting e-mail pages other moments without any piece peacoat. 00:00:46.520 --> 00:00:50.000 OK so Escurial only means no place code. 00:00:50.100 --> 00:00:57.510 So all our pages that we have created so far using a shemale Sierre says javascript equerry and bootstrap 00:00:57.510 --> 00:01:02.380 they are all static pages with static content. 00:01:02.740 --> 00:01:12.850 OK so if we request an email page with no BHB then this page is sent directly to the browser. 00:01:12.930 --> 00:01:19.600 OK so we've got all the HMS content returned to us and we can see the page on our screen. 00:01:20.310 --> 00:01:21.610 OK. 00:01:22.350 --> 00:01:26.110 Now we're going to move to something different. 00:01:26.160 --> 00:01:31.080 We're going to have a look at pages that we call dynamic pages. 00:01:31.110 --> 00:01:31.700 OK. 00:01:32.010 --> 00:01:38.790 So we're going to start creating those dynamic pages and these dynamic pages they will include some 00:01:39.030 --> 00:01:41.120 BHB in them. 00:01:41.270 --> 00:01:46.330 So what's going to happen now is the user will still still send the request to the server. 00:01:46.800 --> 00:01:52.120 By this time the file he's requesting is going to have some code in it. 00:01:52.890 --> 00:02:02.440 So what happens is any data that the user will send to this file is could be log in details. 00:02:02.520 --> 00:02:05.120 It could be any kind of barometers. 00:02:05.160 --> 00:02:05.560 OK. 00:02:05.790 --> 00:02:14.310 So once the data is sent to the PSP file that the PSP file is going to process the data for us and then 00:02:14.310 --> 00:02:20.880 based on that it will build a and Ishmail page which is going to be returned to the browser. 00:02:21.080 --> 00:02:22.200 And then we can see it. 00:02:22.770 --> 00:02:30.630 OK so let's have a look at a few examples to understand this in a clear way. 00:02:30.750 --> 00:02:44.100 So let's go to a video page on YouTube so we know that all video pages on YouTube they have the same 00:02:44.100 --> 00:02:45.370 layouts. 00:02:45.490 --> 00:02:46.070 OK. 00:02:46.290 --> 00:02:48.940 You will always see a video right here. 00:02:49.230 --> 00:02:51.640 You'll see a title right there. 00:02:51.870 --> 00:02:54.770 You'll see the user who uploaded the video there. 00:02:55.080 --> 00:02:58.290 How many people have subscribed to that channel. 00:02:58.440 --> 00:02:59.650 The number of views. 00:02:59.700 --> 00:03:02.830 Number of likes dislikes. 00:03:03.990 --> 00:03:10.470 And the list of other related videos. 00:03:11.460 --> 00:03:15.330 Also the You Can Have You can see the same top bar. 00:03:15.450 --> 00:03:18.490 You know the YouTube logo and so on. 00:03:18.540 --> 00:03:21.170 So it's all the same the same layout. 00:03:21.270 --> 00:03:25.430 OK but things will change on the video. 00:03:25.560 --> 00:03:30.450 The title and other things. 00:03:30.480 --> 00:03:32.490 All right. 00:03:32.490 --> 00:03:43.410 So if we compare both these pages if we look at the address bar you will see that's the first piece 00:03:43.410 --> 00:03:45.470 of the address bar is the same. 00:03:45.480 --> 00:03:48.090 OK there you two does come for Slash. 00:03:48.120 --> 00:03:50.780 Watch and question mark. 00:03:50.800 --> 00:03:51.890 Same thing. 00:03:52.500 --> 00:04:00.690 But if you look closely you will see that this is followed by a barometer V equals and you cause a value 00:04:00.690 --> 00:04:03.500 for that barometer for this video. 00:04:03.780 --> 00:04:08.400 But we've got another value for that Parminter this video. 00:04:08.400 --> 00:04:15.510 So what's trailing here is when we send the request for this page we send a barometer with that value 00:04:15.520 --> 00:04:16.120 . 00:04:16.830 --> 00:04:22.230 And if you go to if we go back to our flowcharts. 00:04:22.680 --> 00:04:26.980 So the promise of V is going to be sent to our PSP file. 00:04:27.180 --> 00:04:27.750 OK. 00:04:27.970 --> 00:04:31.500 And then the page peafowl is going to process that barometer. 00:04:31.920 --> 00:04:35.280 And this is going to look for the corresponding video. 00:04:35.700 --> 00:04:43.680 The corresponding title the corresponding user who uploaded the video number of views likes dislikes 00:04:43.710 --> 00:04:44.340 and so on. 00:04:44.610 --> 00:04:52.920 And then he's going to populates the email page and then he's going to create this a shameful code for 00:04:52.920 --> 00:04:54.760 us. 00:04:56.270 --> 00:05:04.620 OK then if you compare this HMO code with that HMO code you will see that they are the same. 00:05:04.650 --> 00:05:08.860 The only thing that will change is the content of of them. 00:05:09.240 --> 00:05:10.240 OK. 00:05:11.090 --> 00:05:12.750 It's the same layout same everything. 00:05:12.780 --> 00:05:16.960 But we just changed the video title and so on. 00:05:18.060 --> 00:05:19.420 OK. 00:05:22.250 --> 00:05:26.040 Now let's look at a another example. 00:05:26.260 --> 00:05:29.440 So let's have a look at the Facebook logon page. 00:05:29.960 --> 00:05:45.310 OK so BHB can help us restricts unauthorized access to our Web sites and basically we can do this through 00:05:45.310 --> 00:05:46.070 various ways. 00:05:46.060 --> 00:05:49.270 One way is using a logging. 00:05:49.280 --> 00:05:52.480 So you want your users to be signed up. 00:05:52.690 --> 00:05:56.770 Now they need to log in so that they can access your page. 00:05:56.810 --> 00:06:03.270 So what happens when we get inputs logging details and we click on the logging button. 00:06:03.290 --> 00:06:08.870 So let's just try to click on the log in button without any details on it. 00:06:09.080 --> 00:06:15.980 So he gets a page with an error message but if you look at the address bar you will see that our request 00:06:15.980 --> 00:06:20.640 has been sent to a file called loggin dot BHB. 00:06:20.720 --> 00:06:26.230 So that's the file that we have here on the server which is going to process our data. 00:06:26.360 --> 00:06:32.680 So we have sent blank details to this file this log in most places we file. 00:06:32.840 --> 00:06:33.450 OK. 00:06:33.860 --> 00:06:39.750 So this this is what that file was returned to us. 00:06:39.750 --> 00:06:41.290 OK. 00:06:41.960 --> 00:06:51.080 If we log in with Carex details then the log in those PSAP file is going to directs us to the to our 00:06:51.130 --> 00:06:52.640 Facebook page. 00:06:52.680 --> 00:06:53.940 OK. 00:06:54.750 --> 00:07:02.000 OK so the same thing applies for the sign up for all of the sign up for me a little bit different because 00:07:02.210 --> 00:07:09.200 if you put all the details there and they're all valid then once you click on Create an accounts there 00:07:09.190 --> 00:07:14.080 will be a change which will happen on a database. 00:07:14.090 --> 00:07:19.430 So we're going to add a new user to the users database. 00:07:19.850 --> 00:07:20.390 OK. 00:07:20.500 --> 00:07:24.120 With all the details that you would have in putting in here. 00:07:24.970 --> 00:07:29.700 So APHC can also interacts with databases. 00:07:29.710 --> 00:07:30.710 OK. 00:07:30.940 --> 00:07:37.930 To add data to a database or change data to a database and also it can retrieve data from a database 00:07:37.940 --> 00:07:40.160 like we have seen here. 00:07:41.490 --> 00:07:50.230 To all this data is retrieved from a database based on the barometer that we have sent over that. 00:07:50.770 --> 00:07:58.370 OK let's have a look at another example using PSP we can also create contacts forms. 00:07:58.440 --> 00:07:59.070 OK. 00:07:59.140 --> 00:08:03.990 And by clicking on by putting in data and clicking on to send e-mail 00:08:06.620 --> 00:08:12.780 data is going to be sent to an e-mail address that would have set up in the BHB code behind this contact 00:08:12.770 --> 00:08:13.320 form. 00:08:13.340 --> 00:08:18.460 We're going to create a contact form later on very similar to this one. 00:08:19.430 --> 00:08:29.270 Another use of BHB is sending in encrypted data so we can encrypt data for safe transmission of over 00:08:29.260 --> 00:08:31.350 the internet. 00:08:31.820 --> 00:08:38.020 Especially if you're putting some payment details. 00:08:38.060 --> 00:08:38.540 OK. 00:08:38.770 --> 00:08:44.460 So you want to make sure that the data is sent encrypted. 00:08:45.010 --> 00:08:45.300 OK 00:08:47.180 --> 00:08:49.620 . 00:08:54.470 --> 00:09:03.860 If I select the payment type and go for these bits then the card number OK and all the other details 00:09:04.220 --> 00:09:08.770 they are going and they need to be encrypted for safe transmission ordinance 00:09:08.770 --> 00:09:17.440 . 00:09:17.680 --> 00:09:21.970 So we're going to do going to open Firefox. 00:09:21.970 --> 00:09:30.670 We're going to go to the two fi Sep and just click on FCP and it will land here. 00:09:31.000 --> 00:09:31.950 OK. 00:09:32.720 --> 00:09:37.970 So you would need to connect to the singlets you have created. 00:09:38.300 --> 00:09:38.930 OK. 00:09:39.350 --> 00:09:44.360 If you don't if you don't remember exactly how we do that just go back to the beginning of the ASML 00:09:44.360 --> 00:09:45.290 chapter. 00:09:45.290 --> 00:09:47.030 This is explained in detail. 00:09:47.030 --> 00:09:50.070 So it is going to click on Connect. 00:09:51.380 --> 00:09:55.150 And now I can see the files on the server over here. 00:09:55.370 --> 00:09:56.270 OK. 00:09:56.260 --> 00:09:59.330 And on the left hand side I can see files on my computer. 00:09:59.440 --> 00:10:06.660 So this is our cost folder with all the chapters we have created so far. 00:10:07.360 --> 00:10:13.580 Others say we're going to be testing at BHB files on the servers are going to be creating those files 00:10:13.580 --> 00:10:14.740 in here. 00:10:14.920 --> 00:10:17.350 I'm still going to create a page before the 00:10:20.570 --> 00:10:22.210 in the course Varla. 00:10:22.350 --> 00:10:22.920 OK. 00:10:23.520 --> 00:10:26.170 So Grace directory. 00:10:26.490 --> 00:10:34.270 I'm going to call it six BHB where I am going to store all the files are going to be testing on the 00:10:34.270 --> 00:10:34.730 set. 00:10:34.870 --> 00:10:35.270 OK. 00:10:35.280 --> 00:10:38.870 So that I can keep all the files together in the course for them. 00:10:39.000 --> 00:10:40.960 I suggest you do the same thing. 00:10:41.730 --> 00:10:48.540 So when we're going to do on the server side I'm going to create a new directory I'm going to call it 00:10:49.730 --> 00:10:51.050 ph B. 00:10:51.840 --> 00:10:56.610 And then inside BHB I'm going to create a new file 00:11:02.670 --> 00:11:08.730 and I'm going to call it hello world. 00:11:08.730 --> 00:11:13.880 Don't be a 3D extension for PSP files is PSP. 00:11:14.180 --> 00:11:21.470 So not going to create our first PSP file or first PSP page so I'm going to open this. 00:11:21.700 --> 00:11:22.190 OK. 00:11:22.560 --> 00:11:24.950 You can do control now all this. 00:11:25.080 --> 00:11:26.250 Right click and open 00:11:26.700 --> 00:11:34.260 . 00:11:37.430 --> 00:11:42.680 Of course our Hello world file here. 00:11:42.870 --> 00:11:52.710 So I'm just going to switch the forward to BHP rather than push Trump. 00:11:55.580 --> 00:11:58.630 OK. 00:12:01.610 --> 00:12:07.290 It's open folder and go to the desktop. 00:12:07.300 --> 00:12:12.410 Good to be here. 00:12:13.920 --> 00:12:16.020 OK so we've got our file there so it's going to do. 00:12:16.020 --> 00:12:21.900 I'm going to open it again open like this. 00:12:21.900 --> 00:12:22.140 OK. 00:12:22.140 --> 00:12:23.860 So we called our Hello world. 00:12:24.060 --> 00:12:25.330 Please be father. 00:12:25.350 --> 00:12:34.080 So now we just going to write some code there and then we going to open our first BHB page. 00:12:34.170 --> 00:12:37.650 So the syntax for BHB code is pretty simple. 00:12:37.710 --> 00:12:41.390 We need to place all the code inside a tag. 00:12:42.270 --> 00:12:45.830 OK. 00:12:46.310 --> 00:12:49.670 At the beginning of the task you'll have a question mark. 00:12:49.680 --> 00:12:51.900 And also at the end we're going to have a question. 00:12:52.360 --> 00:12:55.730 At the officer the first question Mark we're going to have BHB. 00:12:56.370 --> 00:12:57.190 OK. 00:12:57.510 --> 00:13:01.670 So this writes a simple line of code. 00:13:01.770 --> 00:13:07.420 So we're going to write echo followed by a string string. 00:13:07.440 --> 00:13:08.000 OK. 00:13:08.310 --> 00:13:16.020 So Echo is a simple function which is just going to write whatever is going to print whatever it writes 00:13:16.470 --> 00:13:18.060 in the string on our page. 00:13:18.060 --> 00:13:20.730 So you just write Hello world 00:13:22.980 --> 00:13:24.990 . 00:13:25.990 --> 00:13:28.510 It's safe. 00:13:28.950 --> 00:13:32.400 And now if we open the page. 00:13:32.430 --> 00:13:40.830 So let's go back to a FCP and see where we've closed the page so we have placed this inside the page 00:13:40.830 --> 00:13:45.040 before the need for the name of our file Hello World us page. 00:13:45.040 --> 00:13:46.390 So we're going to do. 00:13:46.470 --> 00:13:48.840 I'm going to open the web browser 00:13:52.100 --> 00:13:54.620 I'm going to go to. 00:13:55.520 --> 00:14:01.240 Hello developers. 00:14:04.260 --> 00:14:08.120 OK what was it. 00:14:09.690 --> 00:14:10.630 Hello developers. 00:14:10.650 --> 00:14:15.570 OK. 00:14:19.350 --> 00:14:19.890 OK. 00:14:20.040 --> 00:14:22.840 It's 8 9 0 0 00:14:28.520 --> 00:14:34.570 0 was last page. 00:14:36.280 --> 00:14:37.660 Take this. 00:14:38.390 --> 00:14:38.750 OK. 00:14:38.780 --> 00:14:41.130 And now we can see our father. 00:14:41.280 --> 00:14:42.200 Hello world of peace. 00:14:42.210 --> 00:14:45.000 So if you click on it we see Hello world there. 00:14:45.240 --> 00:14:45.600 So 00:14:48.660 --> 00:14:53.510 if we click right and go to inspects elements we just have to look quickly at the symbol code. 00:14:53.520 --> 00:15:00.130 So you've got a simple a simple page and we can see the e-mail tags there. 00:15:00.150 --> 00:15:04.260 The head is empty because the body inside the body we call it. 00:15:04.290 --> 00:15:05.300 Hello world. 00:15:05.760 --> 00:15:07.310 OK. 00:15:08.550 --> 00:15:14.510 And that's reflects exactly what we have written inside the HP coding. 00:15:14.970 --> 00:15:15.590 OK. 00:15:16.080 --> 00:15:21.700 So the so PSP just created a page for us. 00:15:21.900 --> 00:15:31.040 So the page consists of very simple tags HBL tags empty head by just placed whatever we have recent 00:15:31.040 --> 00:15:35.210 using the echo function inside the body. 00:15:35.490 --> 00:15:36.360 OK. 00:15:36.660 --> 00:15:44.910 So in the next video we're going to have a look at how to embed BHB in a shemale