One page login form using PHP MySQL Select Query

This login script provides the authentication for our web page. This is one page Php login Script using PHP MySQL Select Query. Click the submit button then execute this PHP script.

PHP MySQL Select Query

The basic syntax of the select Query. Example is given below

To select all columns from the table using * character.

This is real life MySql database structure. ID is an AUTO_INCREMENT column. It is count number of table rows. The username column is for the username. The password column is for the password and client_status is for the client_status.

database structure

How to make this database

Please see follow the number.

create mysql database

How to insert data in the Mysql database table

Open MySql database select table and then click the SQL tab and put this sql quarry given below and then click the GO button.

PHP MySQL Select Query

Our database is created and show database value. ID,username,password,client_status is a table Field name.

MySQL Database

PHP Login Form with Sessions

This is a login.php page. First, include config.php. config.php is a database connection page. Next start Session variables. This Session store individual client information. Next if condition. User press the login form submit button then this condition is executed. Condition is to catch this server value $myusername,$mypassword PHP variables, and execute PHP MySQL Select Query. When all three condition is match then login now be successful. my_client2 is MySQL database table name. This $rows value is not empty then redirect dash.php otherwise redirect login.php. If you have deactivated client_status value then logging will not be successful.

config.php

logout.php