Wednesday, January 13, 2021

Create a Login and Logout easily for a Web-Base System - using PHP, MySql, HTML



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.



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.


login.php



home.php



database connection.php



login process.php



logout process.php



Download Source Files

We only allow you to publish relevant and respectful comments. Vulgar, hateful, or spam comments will be removed.

Whatsapp Button works on Mobile Device only