Description
Hello everyone! Welcome to my first video. In this video, today you are going to learn how to create a login and logout system easily for a web-based system using PHP, MySql, HTML. First, you need to Install a localhost server(eg:- XAMPP, WampServer) to your pc. Then go to the htdocs file in the localhost server. Then create a new folder inside the htdocs name login(you can use any name for this folder). Then you need to create those files "database connenction.php", "home.php", "login.php", and "logout process.php" inside that login folder. Now files are ready.
Then open the localhost app and start the apache module and MySQL module. Now you are ready to start coding. As you see on the video first start to code the login.php file. You need to create the login form in that file. Then start to code the home.php file in that file you need to include the logout button. Then go to the localhost server app and click the admin button of the MySQL module. Then you can access the phpMyAdmin. Then you need to create a new database name "login_db". Inside that database create a new table name "login". Then you need to add suitable columns like in the video to the table with a column name, type, and length. After the table is done your database and the table is ready to use.
Now you can create the database connection in the database connection.php file. Do it by following the video. After it was done then start to code the login process.php file like in the video. Write the PHP code to start the session in both login process.php and home.php files. And then connect the login process.php file to the form using the form attribute "action" and the to method use post. Then your login is ready.
Starting the logout process, In the logout process file, you need to include the database connection and write the code to destroy the started session. Do it as in the video. Then your login logout system is ready to use. Try it by using a rich interface like showing in the video. hope this video is helpful for you to get an idea about how to create a login and logout system.
You Might Also Like
- Contact Page | With Sending Emails
- Create A PHP Send Email Contact Form
- Server Side Ajax JQuery CRUD Data Table
Source Codes For Login and Logout System
All the source codes and source files and available to download from here. Use the download button or copy and paste the code from the text editors. My opinion is first try to do it by following the video line by line. It will help you t o understand all of it. After that, if your code is wrong or not working use the given source codes to compare with your code. It will help you to understand all of your mistakes.
when i login i will only refresh the page
ReplyDeletesame as mine
DeleteWhen i click on login button it is not moving to home page.
Delete