WEBVTT 00:00:07.920 --> 00:00:13.530 All right now that we understood the logic of our app we are now ready to start building the different 00:00:13.530 --> 00:00:15.650 files and tables. 00:00:15.660 --> 00:00:17.500 We get a need for our projects. 00:00:17.520 --> 00:00:22.630 So first of all we need to create a database where we're going to create our tables. 00:00:22.740 --> 00:00:26.760 So to do this we're going to need to go to your C panel and then go to databases. 00:00:26.820 --> 00:00:31.290 My Escurial databases now to create a database. 00:00:31.290 --> 00:00:33.460 You can just choose a name for the database 00:00:36.510 --> 00:00:39.340 and then click on create a database. 00:00:40.600 --> 00:00:42.510 Let's go back. 00:00:42.840 --> 00:00:47.750 Now we're going to need to create a user and Ali to our database. 00:00:47.910 --> 00:00:48.650 OK. 00:00:49.050 --> 00:00:51.820 So let's create a new user. 00:00:52.190 --> 00:01:01.370 So it's just a name for a user and generates a password using the password generator. 00:01:02.110 --> 00:01:07.860 So make sure you store these passwords somewhere because you get a needed later to connect to the database 00:01:07.880 --> 00:01:09.060 . 00:01:09.060 --> 00:01:10.080 Let's use this password 00:01:16.010 --> 00:01:18.470 and just click on create user. 00:01:19.490 --> 00:01:23.740 All right so now our user is created. 00:01:25.140 --> 00:01:27.340 OK. 00:01:29.490 --> 00:01:34.960 Now let's add this user to our database so if you scroll down you'll find. 00:01:35.020 --> 00:01:36.560 Use it to database. 00:01:36.590 --> 00:01:39.370 So that's our user and that's our database. 00:01:39.480 --> 00:01:40.680 And click on it 00:01:46.740 --> 00:01:49.350 and it'll give our user all privileges. 00:01:49.350 --> 00:01:49.820 OK. 00:01:49.980 --> 00:01:53.970 And click on make changes. 00:01:53.970 --> 00:01:54.340 OK. 00:01:54.690 --> 00:01:58.010 Let's go back. 00:01:58.010 --> 00:02:03.470 All right so now we've got a database and of course a user and our user can connect to the database 00:02:04.020 --> 00:02:06.420 as we have just added them to a database. 00:02:06.430 --> 00:02:08.500 All right. 00:02:08.640 --> 00:02:11.040 Right now let's create the different tables. 00:02:11.160 --> 00:02:14.840 We're going to need for our log in and sign up processes. 00:02:14.850 --> 00:02:18.170 So let's go back to our panel. 00:02:19.620 --> 00:02:20.200 OK. 00:02:20.520 --> 00:02:24.690 And let's go to BHP might I'd me. 00:02:26.490 --> 00:02:31.460 OK. 00:02:37.440 --> 00:02:38.920 So it is our database. 00:02:39.060 --> 00:02:41.230 So is Collins. 00:02:42.870 --> 00:02:47.720 So we don't see anything in the moments that we haven't created any tables yet. 00:02:47.850 --> 00:02:51.690 So to create a table let's give it a name. 00:02:51.690 --> 00:02:53.980 So it starts with our uses tables. 00:02:54.030 --> 00:03:01.400 That's where we're going to get all the users details like their user name email and password. 00:03:02.730 --> 00:03:05.460 And when are we going to go for 00:03:08.630 --> 00:03:09.880 five columns. 00:03:09.930 --> 00:03:14.570 OK. 00:03:19.300 --> 00:03:24.060 OK so the first field is going to be the user ID. 00:03:25.270 --> 00:03:25.880 OK. 00:03:26.070 --> 00:03:27.690 So that's going to be an integer. 00:03:27.900 --> 00:03:31.550 And that's going to identify our user. 00:03:31.710 --> 00:03:37.650 So we're going to need to use the auto increment option for this field. 00:03:37.830 --> 00:03:39.020 OK. 00:03:39.750 --> 00:03:49.650 So if you remember this option will allow a new user to take the next user id in an incremental way 00:03:49.650 --> 00:03:52.560 which means the previous user id plus one. 00:03:52.920 --> 00:03:56.760 OK so the next field is going to be the user name. 00:03:57.930 --> 00:03:58.430 OK. 00:03:58.620 --> 00:04:02.440 And we're going to go for a walk. 00:04:02.750 --> 00:04:03.840 OK. 00:04:04.620 --> 00:04:10.870 With a maximum number of characters of 30. 00:04:11.190 --> 00:04:17.490 Next we're going to need the e-mail you can go for a virtual as well. 00:04:18.070 --> 00:04:20.540 And the maximum here is going to be 50. 00:04:21.120 --> 00:04:25.410 And then we're going to need the password. 00:04:27.180 --> 00:04:30.890 It's about as well with a maximum of three characters. 00:04:30.930 --> 00:04:38.390 And finally we get you the activation field which we'll will use to actually raise the account our user 00:04:40.050 --> 00:04:56.360 when they sign up and we're going to go for a volunteer or in this case actually we can go for a char 00:04:58.860 --> 00:05:09.410 and we're going to go for a maximum of 32 and I'm going explain later why we chose this or it nounless 00:05:09.450 --> 00:05:10.800 click on Save 00:05:15.820 --> 00:05:21.440 So he goes oh I use his table now just one comment. 00:05:21.440 --> 00:05:26.150 For now we are building these tables manually for clarity reasons. 00:05:26.380 --> 00:05:32.720 I recommend you write some code for creating these tables so that if you want to transfer your projects 00:05:33.470 --> 00:05:37.900 to another server you find it easy by just writing the queries. 00:05:38.090 --> 00:05:40.070 OK. 00:05:40.460 --> 00:05:45.140 All right now we're going to move to the next table that's going to be the Remember Me table which we'll 00:05:45.200 --> 00:05:50.930 use to remember users who takes the remainder of the checkbooks when they logged in. 00:05:50.930 --> 00:05:57.000 So let's click on new and give it a name. 00:05:57.160 --> 00:05:57.770 It's going to be. 00:05:57.800 --> 00:06:00.340 Remember me. 00:06:00.340 --> 00:06:04.570 So the first field is going to be the ID of the record. 00:06:05.060 --> 00:06:05.520 OK. 00:06:05.600 --> 00:06:16.160 It's going to be an integer and you need to make it or to increment the next one is going to be the 00:06:16.190 --> 00:06:19.960 first authenticator. 00:06:22.020 --> 00:06:23.380 OK. 00:06:24.500 --> 00:06:33.690 And the second one the next one is going to be if two of all of them to be catered to. 00:06:33.860 --> 00:06:37.320 We covered all this in the logic of the OP. 00:06:37.520 --> 00:06:42.920 So the type of the first one we're going to go for a fixed number 00:06:45.650 --> 00:06:47.020 of characters. 00:06:47.050 --> 00:06:54.120 We're going to go for John and the number are going to go for is 12. 00:06:54.170 --> 00:06:55.510 I'm going to explain this later. 00:06:55.760 --> 00:06:56.290 OK. 00:06:56.510 --> 00:07:01.910 So the second one is going to be as well. 00:07:01.910 --> 00:07:05.950 And I'm going to go for 64. 00:07:07.170 --> 00:07:07.880 OK. 00:07:08.420 --> 00:07:11.660 We'll go back to this later. 00:07:11.660 --> 00:07:12.240 All right. 00:07:12.260 --> 00:07:17.480 Next one is going to be the user ID. 00:07:19.470 --> 00:07:24.430 And as an integer you're going to need to add another column 00:07:28.340 --> 00:07:29.750 and it's going to be the 00:07:32.630 --> 00:07:35.910 expiry date or time. 00:07:36.290 --> 00:07:38.290 OK. 00:07:39.350 --> 00:07:46.890 So the type with this one is going to be date and time. 00:07:50.510 --> 00:07:53.110 Right click on say. 00:07:54.270 --> 00:07:55.450 OK so it of course. 00:07:55.520 --> 00:07:56.660 Second table. 00:07:56.660 --> 00:07:58.940 Now let's move to the next one. 00:07:59.720 --> 00:08:03.300 So that's going to be the forgoes password table. 00:08:03.940 --> 00:08:04.590 OK. 00:08:04.880 --> 00:08:08.500 So the first field is going to be the ID of the record. 00:08:09.220 --> 00:08:13.830 And we're going to give each the auto increment option. 00:08:14.900 --> 00:08:17.900 OK the next one is the user id 00:08:21.620 --> 00:08:26.220 and the next one is going to be the validation key. 00:08:26.560 --> 00:08:29.310 OK. 00:08:29.690 --> 00:08:33.690 All the security key as you will create in our APHC code. 00:08:33.860 --> 00:08:40.810 So we're going to go for a char a. 00:08:40.940 --> 00:08:47.450 The key is going to have a fixed number of characters who are going to be using the same amount of memory 00:08:47.450 --> 00:08:48.070 . 00:08:48.620 --> 00:08:51.330 And we're going to go for a length of 62. 00:08:51.580 --> 00:08:54.630 OK we will cover this when we write the page Bickert. 00:08:55.050 --> 00:08:55.950 Okay. 00:08:56.570 --> 00:09:00.390 And then we have a time column. 00:09:00.740 --> 00:09:11.420 So just to be able to muster both the date and time type and must and using that time as an integer 00:09:11.720 --> 00:09:15.780 I'm going to go for an integer for the time in here. 00:09:15.920 --> 00:09:16.590 OK. 00:09:16.970 --> 00:09:25.550 Unlike the previous table where we set the time or the expiry column to date and time are we going to 00:09:25.550 --> 00:09:31.150 need another column which is going to be the same use. 00:09:32.110 --> 00:09:33.410 OK. 00:09:33.410 --> 00:09:33.830 And 00:09:37.310 --> 00:09:47.980 let's go for a bottle of 7 characters. 00:09:49.520 --> 00:09:56.600 So if you remember from the logic Cedras is going to be either bending or used. 00:09:56.870 --> 00:09:58.900 OK. 00:10:00.110 --> 00:10:06.890 That's why the maximum here is seven characters that is click on Save. 00:10:06.890 --> 00:10:12.670 All right so now we have created all the tables we need for our sign up and log in process. 00:10:12.800 --> 00:10:13.460 OK. 00:10:13.910 --> 00:10:20.610 Now we're going to build the different files and understand their code structure. 00:10:20.660 --> 00:10:20.960 All right. 00:10:20.960 --> 00:10:26.270 Now you would need to go to your filing FCP and build be different files are going to need for the sign 00:10:26.270 --> 00:10:28.020 up and logging processes. 00:10:28.280 --> 00:10:35.330 So for now we've got our index those BHB file which includes the different forms like the logging form 00:10:35.330 --> 00:10:35.560 . 00:10:35.600 --> 00:10:40.220 The user is going to fill those forms and in order to process those forms we're going to need to make 00:10:40.280 --> 00:10:42.870 AJAX calls to other BHB files. 00:10:43.130 --> 00:10:50.010 So those AJAX calls are going to be placed inside a file which will call index days. 00:10:50.060 --> 00:10:57.750 So this is a javascript file where we will place all these AJAX calls and will call or point to other 00:10:58.080 --> 00:10:58.670 files. 00:10:58.690 --> 00:11:06.260 So the first file We're going to need to point to is a file called sign up those BHB. 00:11:06.290 --> 00:11:09.350 So these file is going to take care of the sign up process. 00:11:09.380 --> 00:11:15.960 Once the user clicks on the submit button after filling they sign the form OK. 00:11:16.730 --> 00:11:21.690 The next one is going to be activate those BHP. 00:11:22.430 --> 00:11:23.110 OK. 00:11:23.720 --> 00:11:30.230 So that's the file where we're going to direct our user once they click on the activation link that 00:11:30.230 --> 00:11:32.580 they will receive by email after I sign up. 00:11:32.730 --> 00:11:41.660 OK then we're going to have a log in those final which will process the logging data. 00:11:41.990 --> 00:11:42.870 OK. 00:11:43.490 --> 00:11:53.000 Another file We're going to need is the remember me those we file which will process the data if the 00:11:53.000 --> 00:11:57.520 user logs in while checking the Remember Me box. 00:11:57.850 --> 00:11:58.780 OK. 00:11:59.210 --> 00:12:08.090 Now we're going to need another file to process the inputs of the force password and that's going to 00:12:08.090 --> 00:12:11.610 be for good password voicebase be. 00:12:13.330 --> 00:12:15.150 OK. 00:12:17.180 --> 00:12:26.960 Now once the user 7 submits the Fuegos password form they will receive an email ok with a link so that 00:12:26.960 --> 00:12:34.980 link is going to direct them to another file which will call reset password. 00:12:35.180 --> 00:12:36.120 Those plagiary. 00:12:36.230 --> 00:12:44.460 So this file is going to show a new form for our user to reset their password. 00:12:44.570 --> 00:12:45.490 OK. 00:12:46.160 --> 00:12:52.910 So to process that form inside this file We're going to need another file which will call 00:12:57.290 --> 00:12:59.220 store reset password. 00:12:59.420 --> 00:13:03.180 OK. 00:13:05.510 --> 00:13:12.960 So this file is going to update the password for our user. 00:13:16.100 --> 00:13:20.250 OK. 00:13:23.390 --> 00:13:23.650 All right. 00:13:23.650 --> 00:13:28.400 Now let's open all these files in brackets and go through their code structure