Registration, Login in PHP using Xampp server

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay to do a registration for pages in xmap server this is the first thing you're going to do you're going to go into download xampp i'm going to download it should work with linux windows whichever one you have or ios mac system so i'm going to download the windows one so once you download it i've already downloaded it so once you download it open up the app and x xampp so you're gonna open this up and you should see this you should see this as the control panel for the server so it's going to be a local server you're going to press on start apache and start mysql because you're going to be using mysql related database now once you've done this just to make sure it's working go on to the internet browser and just type in localhost now if you get this that means it's been installed correctly and you've got a local host server running now what we're going to do is um open up phpmyadmin so all you do is localhost and type in php my admin at the top on the browser and we should get our phpmyadmin page so the same way we've done it in denver i'm doing it with xsamp now now the first thing i will leave like last time i'm just going to create a database so i'm going to create the data you're going to call it your project so i'm just going to go look project i'm just going to call it project for now you're going to call it your name of the project and press create so now you could see project has been created on the left the next thing you're going to do is go into the project so it's in project and you're going to create a database again you could create it using the structure they have there so you could name it and say how many columns but as you know i prefer doing in sql so once you're in sql i'm just gonna put it in so all i'm doing is saying create a table called users then i'm saying the id should be integer 11 and it should never be null so there should be nothing there and it should be automatically incremented and it should be a primary key then i'm saying username varchar 100 characters again you can't leave it blank email varchar 100 characters don't leave it blank password voucher 100 characters don't leave it blank and then closing the um database and all i'm saying is the defaulting in this now if i press go inside the project i have a table that's been created for users so that's going to be my youth at the moment you can see there's no data inside there because now we're going to start putting data inside there once you have created a user's database go on to your c drive and you should see a folder called xampp xampp go inside there go inside um something called h dock so let me look for where it is where's my one here go hd docs go inside there and i'm just going to create a new folder so um i'm just going to call it project actually so you could call it whatever you want i'm just going to call it project i'm going to go inside the project and inside there now we're going to start doing our coding okay i'm going to do the code and then i'm going to show you i want um what i did okay the first thing i did was created a register.php file as you know i like working in visual studio because it turns them in different colors let me just quickly go for the um register file it's saying include the server.php the server.php file will link um the local host i mean the xm to the my hp my admin database we will go through server php later and the rest of it is just normal html code where i have four imp groups so i've got username email password and confirm password and a button that's all i have and important part with them is having this the form so you post it and post the registration plus php and a little bit of php calls identifying the username so i've got name user and i use the php code to identify as a dollar username and you do the same thing for the others so email password i left it blank confirm password after blank and that's a submit button and once you press the button it will go to server.php and check if the values in the database exist and if it does exist whatever information you put inside those fields should be added to the database now let's look at server php quickly server php again starts initialize everything from zero then it says connect i've changed it so i've called the project now so my database name is project so this is the database connection it connects to localhost root project then is saying if the user is registered get all the information so username post the information there email post it there email is posted there and this is checking for validation this is the checks if the user have entered every fields because remember we said this can't be null value when we created the database we have to make sure the user don't leave anything blank otherwise it's going to send an error and we also have to make sure password1 matches password two if it doesn't matches it should send an error so this sign mean is doesn't matches and the password two doesn't match so here what all he's doing is getting the information from registration.php file the username here and is posting it inside the database where the name is username where the field is username that's what he's doing so then this is the username so select this is a table where username so sorry this is going to be the part of the login so i'm going to show you explain the login page later so this is basically that's adding information so let's try i'm sorry let me just quickly go through another one the error php that's important as well this is checking making sure there is no error in the php okay um in when it's connecting to the database it's making sure there is no error of the coding or error with any connection so only three things we need register page server page server page connects to the database and connects adds information to the data and error error page so those are the three things we need and i'm going to go through login page later on so we're going to quickly test it to make sure the registration page works okay to test it we open up um our browser i go into localhost then remember i created a folder called project so i have to call it project and then i'm going to call it register dot php i've actually designed this using um using css so let me just quickly show you my css as well at the same time so if i open style css this is the css file i've designed using css so if i go to my register here and i'm saying if i go back up and link that css file so you could design it so this is my database now i'm going to add some information so i'm going to write email say my email put password as one two three four and one two three four register that username already exists so i need to re use a different one so i'm going to call it um one two three four one two three four so mahmood one email already exists so that's another issue so i have to make sure i use a different email one two three four one two three four register now so hello it's it's done it is logged in now what i could do is if either show you go back to the code and explain rest of the code now i'm going to explain the login page login page is just the same thing all i have to make sure is the error page is included username password and if that's that's it and it's links to style server again and it says include the server page i'm going to go back to the server page and explain how the login works so now for the login all it does is um let's go to the login section checks if the password matches the information on the user inside the database so if i leave it blank it should say password and username required so then it's going to go and check like the way it did and make sure there is no matching if it i mean make sure if this matches if it matches then you log you in if it doesn't match then it's going to say wrong wrong username and password try again so we're going to i'm going to show you how it's working if you if if we go to our registry um php admin if i go back into project if i go into users you could see my information has been added so mahmood one my email address and and the password i gave don't worry about this and the password i gave is one two three four this is automatic zoom so do not touch this do not let anyone change the password here now i've created a login page as i showed you i'm gonna do is open up that login page um so i'm gonna go into login dot php oops sorry i did it wrong local host dash project that's login dot php okay so this is my login page now my first username was mahmoud one and my password was one two three four if i click login here go you are logged in so now this is my home page this is where you should be starting this is the index page this is this is where you should be your once they log in they should access your home page with all the information you need what i'm going to do is i'm going to give you guys all those codes the codes i have is the only codes i had was the server code register code login and index page is your homepage so let me just show it there so your index page is just your home page and all it's doing is getting the information from the login page and keeping it there that's it and those are again is that saying check if it matches if it matches the success and then you could start designing your home pages so you can say hey welcome to my project page so if i save this quickly if i go back to my refresh it hello welcome to my project page so it's it's up to you how you design start designing the homepage ideally should be inside there i i've done it outside the body so you should have been inside them um it should be that's in the wrong place actually so you should not be there it should be let's say the homepage you should be inside here the content this is where the content is so i could put it there save it again go back refresh it sorry this too messed up okay this is something i have to fix with css but basically this is how you are going to create a database of install xmap then check if your local host works if once you install xmap make sure you start the apache server and the mysql server once you started it go to localhost so let me just quickly show you localhost make sure this page comes up if this page comes up this is saying your local server has been installed properly and then go into c drive xmap htdoc htdoc and inside there you have to install save everything so remember i call the project and inside the project i've got all those files so i'm going to give you guys all those files so you could look at it and use it thank you very much and good coding
Info
Channel: Mahmud Choudhury
Views: 93,697
Rating: undefined out of 5
Keywords:
Id: fsQoA7NMhsU
Channel Id: undefined
Length: 13min 41sec (821 seconds)
Published: Tue Nov 24 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.