Accéder au contenu principal

Articles

Affichage des articles du juillet, 2018

PHP MySQL login

This tutorial demonstrates how to create a login page with MySQL Data base. Before enter into the code part, You would need special privileges to create or to delete a MySQL database. So assuming you have access to root user, you can create any database using mysql mysqladmin binary. Config.php Config.php file is having information about MySQL Data base configuration. <? php define ( 'DB_SERVER' , 'localhost:3036' ); define ( 'DB_USERNAME' , 'root' ); define ( 'DB_PASSWORD' , 'rootpassword' ); define ( 'DB_DATABASE' , 'database' ); $db = mysqli_connect ( DB_SERVER , DB_USERNAME , DB_PASSWORD , DB_DATABASE ); ?> Login.php Login PHP is having information about php script and HTML script to do login. <? php include ( "config.php" ); session_start (); if ( $_SERVER [ "REQUEST_METHOD" ] == "POST" ) { // username and password sent...