#24: User Registration System Using PHP and MySQL Database
In this Article, I'll provide you all information which you need to creating a user registration system where users can create an account by providing username, email and password. Also after registration user can Login and logout by their username which user used for registration.
I will also show you how you can make page accessible only to logged in users. Any other user not logged in will not be able to access that page. For this i'm going to use session of PHP
For Demo & Source Code Scroll down, Before download go through from this article for proper installation.
Quick Start, you need these files to start work on this:
After downloading source code file for this. You will find users.sql file. That file, contains all information about database to be needed for this.
CREATE TABLE `users` ( `id` int(11) NOT NULL, `username` varchar(50) NOT NULL, `email` varchar(50) NOT NULL, `password` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
After installing database, your database should be look like this
Here, I'm going to elaborate how to use files after downloading them.
First, you need to configure database according to your server. After this process you can start further process. Below is the code to connect database.
// connect to the database $db = mysqli_connect('localhost', 'root', '', 'registration');
After these changes you are set to run index.php in localhost server such as xampp or wampp
if you face any issues you can contact by asking question on Developers Community