Learn Advance Login Script Using PHP Secured Function - Build a Functional Login Script | Smita Thapa | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Learn Advance Login Script Using PHP Secured Function - Build a Functional Login Script

teacher avatar Smita Thapa, Engineer / Educator

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

8 Lessons (24m)
    • 1. 1. Introduction to Secure Session Based Login System

      2:25
    • 2. 2. Registration Part 1

      1:50
    • 3. 3. Registration Part 2

      3:28
    • 4. 4. Registration Part 3

      4:51
    • 5. 5. Login System

      3:48
    • 6. 6. Remember Me

      3:10
    • 7. 7. Index Page & Logout System

      0:56
    • 8. 8. Protect Page Functions

      3:10
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

59

Students

--

Projects

About This Class

Secure Session Based Login System Using PHP & MYSQL

In this class I will teach about how to create a secure, session-based login system in PHP.
This course will mostly focus on the process of USER REGISTRATION AND SECURE LOGIN SYSTEM.
All the concepts are explained in detail and at the end each viewer can easily make a secure login system.

This course will cover the followings:

1. Secure, session-based user access
2. User registration
3. Remember me feature
4. SQL injection prevention
5. Password Encryption
6. Protecting Pages with PHP Functions

And more...

--------------------------------------------
Students should have basic knowledge of HTML, CSS and PHP before taking the course.
--------------------------------------------

Meet Your Teacher

Teacher Profile Image

Smita Thapa

Engineer / Educator

Teacher

I dedicated my last 10 years to learn and explore web development programmings. As a web programmer, I have contributed my knowledge to large organization and some of the biggest projects. I love learning and sharing my knowledge as I believe that more you share more you gain.

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. 1. Introduction to Secure Session Based Login System: Hello, everyone. Welcome to the course. In this course, we will learn how to create full functioning, Secure says and best long Miss Creeped, Let me tell you that this course is separated into six different section. The 1st 1 is introduction which is this video. The 2nd 1 will be working on sign up or registration feature. 3rd 1 will be working on signing or log and feature. The 4th 1 will be working on Remember May feature. The 5th 1 will be pays protection functions in PSP and the last is working with the about section in the registration section. We will create a database on table. The devil name is logging with I D email and password as a columns. And here we will learn about all the inserting data script weak sick your validation in the log in section or sign in section as I have already mentioned you, that this is an advanced PSB logging discreet. So the difference is as in same for PSP. We create individual pages for each individual coding But in this course we are going to create peace be functions in place off individual PSB pages which will advancement the code on Also hide all the peace be basis link from both short scored and inspect lemon. And after logging, we will work in Remember me section? Well, most a few people may already have the idea off. What? Remember me featured us, but let me tell you briefly how it works. It's a feature with allows broader to memorize the huge your name and password After you close the browser later travel it's plain you moored Italy in video section after the remember me section, we have the protection pace functions on the production pace functions is all about securing the pages which are not allowed to be exist before or after logging on. Last but not least, we will work with the home per section where we have simply ah, log out bottom which will destroy the station. So this is the brief introduction off our course. We will see you in the next videos. Thank you for being with us. See, you should 2. 2. Registration Part 1: Hello, everyone. Welcome to the course now without delay. Let's start the registration from So before starting the registration form, we need this tree pages connect the PSP function, start peace. Be on any dot PSB in connected piece BV, evil star bliss data this connection and if the connection will not a stop list, then it will. So an Aramis is on this function returns the convertible Now in the emitter peace be We will start or initiate decision. Then we will include all the pages that is required in our protest Like Connick that peace be function start peace Be now in the function studies be bays We will create some functional street like inserting details Validations ex cetera Well, no, let's come to registration pace And as you can see here I have already done the best email and see is this part So here in this course I'm not going to touch is TML and see Is this part on will directly jump to the PSP called No fuss Terfel We need to include in it that PSB which will start the stations and also it will include the pages that we needed in this project Okay. Now, as you can see here, the phone method boast Onda. We have user names, email and password. Read the names off me button. Okay, so, first of all, we need to create the database on the log in table on the logging table with I d. Use the name, email and password as a feels We'll see you in the next two. Serial on in the next two to gov will proceed on Father Cody. Thank you. 3. 3. Registration Part 2: Hello everyone. Welcome to the course. Now let's continue with registration that psb So before that go to fund. Since the PSP pays and in front centerpiece be, we will make a function called sanitize with little sanitize all the datas we will get in this project. So go ahead and make a function The city does function will give the data in every function you need the convertible which will a star blister connection with data bus. And as I have told you, that it will return the sanitized data. So dysfunction region my scale like really skip stream and inside of this we need this gun Variable on then data. Now let me tell you my school I realists kept string is used to escape the special characters from the detail on you need to escape such characters in order to avoid the fiscal injection. Well after this saved this page and come to registration that peace be paid. As in the previous studio, I have told you that we have name, email and password and then we have a sub me button. So when those suddenly Burton will be clicked, the form will post the details now after this make the very ever used your name Sandy dies . That is the function we have just created to sanitize the data. Similarly, we will do for email and password. Now we have all the data is given by the huger. So what you need to do these, you need to increase the password. That means you need to change the password into every five. Simply you use empty five function and just put password over here. Now, this will encrypt the password. Now, after this, what we need to do first is we need to check whether the email given by the huger is exist in our database or not. Now, to check if the mayor exist or not, we will make a function in the function that BSP this man and just function will get the mail from the huger foster for Let's any dies. They enough After this, we'll write. The Cordy on this query will tell you the email and it will return the number off i d if it is present. So you can see the simple Corey count idee as total from logging table where America goes Dream Now if the idea count is graded inju that Mr Meal Ideas edges so it will written true else. Intelligent, false find. We have made the mail and dysfunction to save this and go to registration page AIDS Now in the registration peace, you need to write if male adjust. I hope the name is correct. Off function and Mel just function. Passing email equals equals True. That means the email suggest in the database. So we will. So the Aramis is So this is the email already exist. Alert, Mrs. On. If the mail does not exist, then we need to insert the details in the database table. Well, friends, we will do those things in the next tutorial. So see that? So thank you for being with us and see you and then next tutorial. 4. 4. Registration Part 3: Hello, everyone. Welcome to course. Now let's continue our inserting. Good. Now, to insert the data will make a function in our funds and start peace. Be. And before that, we will make a variable over here. Log in data it calls to Harry. Now, what you have to write is in the left hand side. You need to write the field name off the table like I d use the name email password. So ideas are to increment. The data will be blank over here now. Similarly, we have more tree field. The 2nd 1 is use your name email on password. Okay. Now, here in the huge a name you will cost the huge. A name off here on email is email. Variable on. Then we have the password key. So we have the logging data. Every variable withs contained this Cherokee and the details. Now, after days go to, for instance, start bsb And here we will create the Lord and functional Scraped. Now create the function logging insert. So this Logan inside function will get this logging data given by the huger. Now, after this, we need to make one more function function. Airy, sunny dies and dysfunction will return the sanitized. Very, very well. Now, after this in the logging inside function. Right, Harry, walk logging data on here. Harry, Sandy tights. Function me. Well, after this, we will make the field very ever on this. Feels very able. Well, actually, hold this, Eric, use that right hand side. As you can see, I d use your name email password. So those everything i d you don't have email password? The field name the Eric ease will hold by this very ever. And for that you need implode function. Similarly, we need the data variable, which holds the data even by the huger. Use your name email Password. Now, Fine. We get this fields and we get there. And now we need to write the cory for inserting in the log in table. Well, see, inserting too long him feels name on, then data values. Now, if the Cory will execute successfully, then it will written true else it will Region falls the save this page, go to registration. That B is B and after this variable make a new very ever long in success on this long in sex is very ever will hold the value either true or Fels which will be returned by this longing inside function. So, as you know, if the data is inserted successfully, then we will get true. Otherwise we will get false. So if logging Subsys equals to true, then we will give the messes to the huger that the registration is successfully done and the peace will redirect too long in the BSB. Now else, if the inserting is not done successfully then we've installed the registration, felt messes and then we will redirect to the same pace registration that psb well, we have finished our script the Save the Peace. Make sure all the bait, all the pages star saved. Now let's go ahead and check our gold if it is executing successfully or not So at first, So in the beginning we get an error. So it is in function start PSP lying, trying to tree unexpected braces. Now it is suing this one, but I think this is okay some problems over here, So Okay, we have Forget this thing in this line. Just add this and save this. Go ahead and reload the brother. So something wrong in our gold again? Okay, I have one small mistake. I have put the dollar sign in front of his state. It should not be done. This Go ahead on reload. Okay, Everything fine. Your name email, and then give the pulse were now take registration. You can see Congratulations, mrs. Over here, that means our ideas created successfully. Now, let's go ahead and check in our database. So as you can see everything, it's insert it successfully on our password is also encrypted. So thank you for being with us. In the next tutorial, we will go in the logging base. 5. 5. Login System: Hello, everyone. Welcome to the course from this tutorial video, we are proceeding to the securities and based logging system, so let's go ahead and let's start well from the log. Inform. Huger will solve made email and password. So let's go to our base. As you can see here we have email and password and then we have log in, submit bottom. So here, after this, if it's $8 on the score post logging submit, that is the bottom name. So if the farm is off made, then we are getting the email and password given by the huge. Similarly, do this for password. Now, after sanitizing email and password, we will go to fund since the PSP and we will create a log in function So this logging will get email and password even by the huger. Well, after this again, get the email Sanitize aid. Also password. Okay, now we will include the password. After this, we will write a Cory to check the data or i d in the table off particular email and password. Okay, so let's go ahead. Loving people there. Email Pickles too. Email Given died, You jerk on Boss Word goals too. Password off. Huge! Fine. So huge data variable girl life, which and inside of this you will put Cory now. Well, count the number off Rose. Now we have number off rose. So you will right here If dollar numb rose is skirted And you that means the idea is present. The idea the email and password is done. The email and password is correct. Um, that's why we will written here Dollar YouTube data I d. So if the email and password is correct, then it will region idea else. It'll written Jew to save this function, start PSP Now go to log in the BSP and after this make a logging very able which will hold the return output off log and function Well, we already know that East logging very well will be equals to do that means the email and possible given by the huger is not correct. So we will alert the mess Is the email or boss work is incorrect. So else that means our email and Bositis correct. Then we will say decision I d. So you know this log invariable will hold the return output off logging. So since the email and password is correct. And it'll region the idea off the huger. So now decision I d will be the idea of the huger. Now we will redirect to the index speech since our logging its success. Well, save the pace and go to the Roger this Reloaded wants and put the wrong email and password forced to chippy error the email positives in correct. Please try again. The messages. Um Okay, now let's pastor correct data. It should redirect to our index speeds. Well, we have finished the logging script and in the next two trio we will be doing this. Remember me? Feature bark. Okay, those see you in the next two to deal. Thank you. 6. 6. Remember Me: Hello everyone, welcome to the course. And in this tutorial, we are going to create some functions reaching, predict our pages. Let me show you what we are doing. So when we login in our system, we are redirected to our index page, okay, but still, if we want to access our login Pais, then we are able to access it. But it should not be done because until and unless the mujer, we'll click the logout button, the user should not be allowed to access that login page. So for that, we need to create a function. And let's go ahead. And in our, since the PSB, let's create the function. So let me create logged in function. And this function will simply written if the session ID is set, then it will return true. Otherwise it will return false. Now let's go ahead and let's create another function, function, long-term inbreeding addict. So this function will simply check if logged in is true, then it will redirect to our index spades and it will exit the function and just save this. And in the login dot PSP after including in indoor PSP, just go ahead and call logged in redirect function. Okay, save this page, go to the browser. Now in the last time we have access the login dot PSP. Now let's try to access it again. As you can see, we could not access the base since we have protect it with the logged in R3 direct function. Similarly, when you logout the system, then without login, you cannot access the index.html ESP. But since we can access it, that means we need to protect this base two. So let's go ahead. And in the functions that PSB, let's make another function to predict the index page. So in the perfect Paste Function, we simply check if logging equals to false, then it will redirect to the login page. Well said the page and copy the name of the function, go to indexer, PSP, and at the very beginning, include any WSP and then call the perfect pays function. Okay, save this. Now let's go ahead and check as v could access the index that BSB before without logging. So let's go ahead and let's index the PSP in the URL. But it will redirect to the login page because we have not logged in in our system and we have perfect based function in our index.html page to log, normally, you can redirect to the index page. Okay, so thank you for being with us. This is the end of the course and we will definitely come with new course in the future very soon. So beaters and keep learning. 7. 7. Index Page & Logout System: Hello, everyone. Welcome to the course today. We will do this index a PSP and log out, not be his protection. So I have already created very simple index piece, as you can see the lager bottom here, where when clicked, log out or PSP will be executed. Now let's go and coat longer, not Bates. So we have here longer. But so in the lover Doherty's be You just need to write, and you need to state decision i d. And when the law goat botnets plate, then it will redirect to our log in page. Well, said the page, now reloaded. Just click the log out. Then you are related to the logging based and the station ID's unseat well ago dot PSP's finished. And in the next 22 year old, I'm going to teach you how to protect the index speech. So thank you for watching See you in the next tutorial. 8. 8. Protect Page Functions: Hello, everyone. Welcome to the course, and in this tutorial we are going to create some functions ritual. Protect our pages. Let me show you what we are doing. So when we log in in our system, we are regarded to our index page. Okay, but still, if we want to access our log in peace, then we are able to access eight. But it should not be done because until and unless the huger real click the log out button , the user should not be allowed to access the log in page so far that we need to create a function on Let's go ahead and in our functions that p it's be let's create the function. So let me create logged in function and dysfunction will simply return. If the station ID's said then it will return true, otherwise it will return falls. Now Let's go ahead and let's create another function function logged end redirect So this function will simply check if logging is true. Then it will read. I'd it to our index spades, and it will adjust the function. Now just say this and in the log under TSB, after including any door PSP just go ahead and call logged in redirect function. Okay, save this page. Go to the Roger. Now, in the last time we have accessed the logging that peace be. Now let's try to access it again. As you can see, we could not access the pace since we have protect eight winter locked in redirect function . Similarly, when you log out the system then without logging, you can access the index that BSP. But since we can access eight, that means we need to protect this base to. So let's go ahead. And in the function, start BSP. Let's make another function to protect the index speech. So in the perfect place function, we simply check if logging the calls to false, Then it will redirect to the log in page. Well, said the page and copied the name off the function. Go to index a PSB and at the very beginning, include any PSP and then call the perfect hates function. Okay, save this. Now let's go ahead and check as we could access the index to PSP before without logging. So let's go ahead and let's try in extra peers being the U area, but it will redirect to the logging base because we have not logged in in our system. On we have perfect pace function in our indexed peace Be pates logging on Lee. You can redirect to the index speech. Okay, so thank you for being with us. This is the end of the course And we will definitely come with new course in the future. Very soon. So be vetoes and keep learning.