Difference between revisions of "PHP-and-MySQL/C4/User-Registration-Part-5/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
Line 18: Line 18:
 
|I can see that when I click in login, again, "Incorrect password".
 
|I can see that when I click in login, again, "Incorrect password".
 
|-
 
|-
|0:37
+
|0:40
 
|This doesn't mean that my username hasn't been found.
 
|This doesn't mean that my username hasn't been found.
 
|-
 
|-
|0:40
+
|0:44
 
|Let me type this in username and type in my password. It will tell me "That user doesn't exists!".
 
|Let me type this in username and type in my password. It will tell me "That user doesn't exists!".
 
|-
 
|-
|0:50
+
|0:52
 
|But here, it is saying that my username does exist but my password is wrong.  
 
|But here, it is saying that my username does exist but my password is wrong.  
 
|-
 
|-
|0:55
+
|0:57
 
|Now, the reason my password is wrong is that my plain text password here is being compared to my "md5-encrypted" password inside my data base.
 
|Now, the reason my password is wrong is that my plain text password here is being compared to my "md5-encrypted" password inside my data base.
 
|-
 
|-
|1:07
+
|1:11
 
|The way we do this is, we go back to our login page, which we covered in the previous tutorial - the userlogin tutorial.
 
|The way we do this is, we go back to our login page, which we covered in the previous tutorial - the userlogin tutorial.
 
|-
 
|-
|1:18
+
|1:21
 
|At the part where we compare our passwords to check if they match. That's checking our username there and this is checking our password.  
 
|At the part where we compare our passwords to check if they match. That's checking our username there and this is checking our password.  
 
|-
 
|-
|1:34
+
|1:35
 
|We need to check our password.  At the moment, let's say I typed in my password as "slicer u k 1".  
 
|We need to check our password.  At the moment, let's say I typed in my password as "slicer u k 1".  
 
|-
 
|-
Line 42: Line 42:
 
|So, this is the password I am typing in here.  Its quite an old one.
 
|So, this is the password I am typing in here.  Its quite an old one.
 
|-
 
|-
|1:56
+
|1:52
 
|"slicer u k 1". Okay and this is checking this and this password here is equal to sliceruk1.
 
|"slicer u k 1". Okay and this is checking this and this password here is equal to sliceruk1.
 
|-
 
|-
|2:06
+
|2:02
 
|But this "password" is equal "dbpassword". So we are not getting the comparison.  
 
|But this "password" is equal "dbpassword". So we are not getting the comparison.  
 
|-
 
|-
|2:12
+
|2:10
 
|We get to choose this when we encrypt our password.
 
|We get to choose this when we encrypt our password.
 
|-
 
|-
|2:19
+
|2:15
 
|So now this will actually be equal to this, so this is encrypted "slicer u k 1",  which is equal to this "slicer u k 1".  
 
|So now this will actually be equal to this, so this is encrypted "slicer u k 1",  which is equal to this "slicer u k 1".  
 
|-
 
|-
|2:30
+
|2:26
 
|So we are comparing an md5 encrypted password to an md5 encrypted password in our database.
 
|So we are comparing an md5 encrypted password to an md5 encrypted password in our database.
 
|-
 
|-
|2:37
+
|2:35
 
|Let me resubmit this form again and login. Oh! error again!   
 
|Let me resubmit this form again and login. Oh! error again!   
 
|-
 
|-
|2:42
+
|2:39
 
|Let me try again.  Click on login. No, its not working.
 
|Let me try again.  Click on login. No, its not working.
 
|-
 
|-
|2:47
+
|2:45
 
|Let's check this. "password" equals to "POST password" so md5 is the password. Let me go back and refresh this.
 
|Let's check this. "password" equals to "POST password" so md5 is the password. Let me go back and refresh this.
 
|-
 
|-
|3:01
+
|3:00
 
|I type my password. Al-right, I know what the problem is here.  
 
|I type my password. Al-right, I know what the problem is here.  
 
|-
 
|-
|3:10
+
|3:06
 
|The problem here is that our md5 password is absolutely correct but it is being compared to a password which is cut short in our database.
 
|The problem here is that our md5 password is absolutely correct but it is being compared to a password which is cut short in our database.
 
|-
 
|-
|3:22
+
|3:18
 
|That's because if we go to our structure and go down to our password field here and edit this, we have currently got a length of 25 as its limit.
 
|That's because if we go to our structure and go down to our password field here and edit this, we have currently got a length of 25 as its limit.
 
|-
 
|-
|3:37
+
|3:35
 
|So we are going increase the limit for this to, say, 100.   
 
|So we are going increase the limit for this to, say, 100.   
 
|-
 
|-
|3:43
+
|3:40
 
|I am not exactly sure how long an md5 string is, but I will say length value = 100.  Save that.
 
|I am not exactly sure how long an md5 string is, but I will say length value = 100.  Save that.
 
|-
 
|-
Line 84: Line 84:
 
|I am going to browse our table and delete this value. Then I am going to go back and re-register.
 
|I am going to browse our table and delete this value. Then I am going to go back and re-register.
 
|-
 
|-
|4.00
+
|3.58
 
|So, register.  Choose your username.  Let's say "alex", like I said before. Choose a password, let's say "slicer u k 1". And I will click "Register".
 
|So, register.  Choose your username.  Let's say "alex", like I said before. Choose a password, let's say "slicer u k 1". And I will click "Register".
 
|-
 
|-
Line 93: Line 93:
 
|Now, let's check our database again. This is looking longer already, it hasn't been cut short because I have changed the length of this.
 
|Now, let's check our database again. This is looking longer already, it hasn't been cut short because I have changed the length of this.
 
|-
 
|-
|4:27
+
|4:28
 
|So now when I try to log back in and let me type this properly.  
 
|So now when I try to log back in and let me type this properly.  
 
|-
 
|-
|4:33
+
|4:34
 
|We can login and we are in. Okay so check things like string length.
 
|We can login and we are in. Okay so check things like string length.
 
|-
 
|-
|4.43
+
|4.41
 
|Hopefully you have got this.  
 
|Hopefully you have got this.  
 
|-
 
|-
|4.45
+
|4.43
 
|If you want me to expand this tutorial please just let me know.
 
|If you want me to expand this tutorial please just let me know.
 
|-
 
|-
|4:52
+
|4:48
 
|And that is user registration.  
 
|And that is user registration.  
 
|-
 
|-
|4:55
+
|4:51
 
|This is followed on from our user login tutorial. So by putting these together, we have got a fully functional user register and login process.  
 
|This is followed on from our user login tutorial. So by putting these together, we have got a fully functional user register and login process.  
 
|-
 
|-
|5:04
+
|5:02
 
|I will be using this in a lot of my project work. Say for example.
 
|I will be using this in a lot of my project work. Say for example.
 
|-
 
|-
|5:12
+
|5:07
 
|I might create a project on something that uses a user login and user registration. So I will be using this a lot.
 
|I might create a project on something that uses a user login and user registration. So I will be using this a lot.
 
|-
 
|-
|5:19
+
|5:17
 
|So check my projects on user login and registration for more information.  
 
|So check my projects on user login and registration for more information.  
 
|-
 
|-
|5:28
+
|5:23
 
|If you have any questions or would like me to expand on anything, please just let me know.
 
|If you have any questions or would like me to expand on anything, please just let me know.
 
|-
 
|-
|5:35
+
|5:30
 
|Please subscribe for updates in the future. Thanks for watching.  This is _________ dubbing for the Spoken Tutorial project.
 
|Please subscribe for updates in the future. Thanks for watching.  This is _________ dubbing for the Spoken Tutorial project.

Latest revision as of 12:38, 22 October 2013

Time Narration
0:00 Welcome to the 5th part of the User registration tutorial. We are going to tidy up a few bits and pieces together in our registration login process.
0:11 Then we'll give a full test to see if it really works.
0:14 In the last part, you saw that I registered myself in this database. Everything has worked out fine and I am at the login screen here.
0:24 Lets see if I can login. Let's say username is "alex" and my password is the password that I used.
0:33 I can see that when I click in login, again, "Incorrect password".
0:40 This doesn't mean that my username hasn't been found.
0:44 Let me type this in username and type in my password. It will tell me "That user doesn't exists!".
0:52 But here, it is saying that my username does exist but my password is wrong.
0:57 Now, the reason my password is wrong is that my plain text password here is being compared to my "md5-encrypted" password inside my data base.
1:11 The way we do this is, we go back to our login page, which we covered in the previous tutorial - the userlogin tutorial.
1:21 At the part where we compare our passwords to check if they match. That's checking our username there and this is checking our password.
1:35 We need to check our password. At the moment, let's say I typed in my password as "slicer u k 1".
1:47 So, this is the password I am typing in here. Its quite an old one.
1:52 "slicer u k 1". Okay and this is checking this and this password here is equal to sliceruk1.
2:02 But this "password" is equal "dbpassword". So we are not getting the comparison.
2:10 We get to choose this when we encrypt our password.
2:15 So now this will actually be equal to this, so this is encrypted "slicer u k 1", which is equal to this "slicer u k 1".
2:26 So we are comparing an md5 encrypted password to an md5 encrypted password in our database.
2:35 Let me resubmit this form again and login. Oh! error again!
2:39 Let me try again. Click on login. No, its not working.
2:45 Let's check this. "password" equals to "POST password" so md5 is the password. Let me go back and refresh this.
3:00 I type my password. Al-right, I know what the problem is here.
3:06 The problem here is that our md5 password is absolutely correct but it is being compared to a password which is cut short in our database.
3:18 That's because if we go to our structure and go down to our password field here and edit this, we have currently got a length of 25 as its limit.
3:35 So we are going increase the limit for this to, say, 100.
3:40 I am not exactly sure how long an md5 string is, but I will say length value = 100. Save that.
3:50 I am going to browse our table and delete this value. Then I am going to go back and re-register.
3.58 So, register. Choose your username. Let's say "alex", like I said before. Choose a password, let's say "slicer u k 1". And I will click "Register".
4:14 "You have been registered. Return to login page".
4:17 Now, let's check our database again. This is looking longer already, it hasn't been cut short because I have changed the length of this.
4:28 So now when I try to log back in and let me type this properly.
4:34 We can login and we are in. Okay so check things like string length.
4.41 Hopefully you have got this.
4.43 If you want me to expand this tutorial please just let me know.
4:48 And that is user registration.
4:51 This is followed on from our user login tutorial. So by putting these together, we have got a fully functional user register and login process.
5:02 I will be using this in a lot of my project work. Say for example.
5:07 I might create a project on something that uses a user login and user registration. So I will be using this a lot.
5:17 So check my projects on user login and registration for more information.
5:23 If you have any questions or would like me to expand on anything, please just let me know.
5:30 Please subscribe for updates in the future. Thanks for watching. This is _________ dubbing for the Spoken Tutorial project.

Contributors and Content Editors

Chandrika, Kavita salve, Pravin1389