Hi Friends! Today i am going to show how to make login form in php and mysql (Firts part)
Register user php mysql
into localhost directory create Login folder, here we add the following files.
We need create the following docs:
conexion.php: Data base conection.
index.html: Página principal del proyecto, desde ahi crearemos el nuevo usuario.
registrar-usuario.php: Script to add new user to the database.
This file is database connection only. We start login session php mysql.
login with php
In this file a simple index has been made (although responsive to educate yourself in this area) with three inputs and two buttons where the user must add their data and password.
You can expand and add more data at your convenience.
In this file we receive the data from the index.html form. They are stored in the variables $ _POST ['password'] and $ _POST [username] to be later inserted into the DB.
Before proceeding with the login, it is verified that the user is not previously registered ($ searchUser, line 15), if so, the operation is aborted and the user is notified that he must choose another nickname. If everything is fine, you are asked to log in using another form, we will see this in the next post: