DEV Community

Priya Ranjan Kumar
Priya Ranjan Kumar

Posted on • Updated on

Creating a user registration System Using PHP and Mysql.

Prerequisite

  • PHP
  • MySql
  • PHP-MySql Connector
  • Ubuntu (Or any Linux Distro)(Pre assuming apache2 is already installed.)

Setting Up Environment

  • Step First: Install PHP using this Command.
  sudo apt-get install php
Enter fullscreen mode Exit fullscreen mode
  • Step Second: Install MySql using this command.
  sudo apt-get install mysql

Enter fullscreen mode Exit fullscreen mode
  • Step Third: Install MySql-Client using this command.
  sudo apt-get install mysql-client

Enter fullscreen mode Exit fullscreen mode
  • Step Fourth: Install PHP and MySql Connector.
  sudo apt-get install php-mysql
Enter fullscreen mode Exit fullscreen mode
  • Step Fifth:
    Open terminal and paste this command to open mysql databse;

     mysql -u root -p1234
    
    
  • Step Sixth:

     Create a **database**
    
     create database logindetails;
    
    
     use logindetails;
    
    
    • Step Seventh: Create a table to store user data
    
       CREATE TABLE `users` (
      `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
      `username` varchar(100) NOT NULL,
      `email` varchar(100) NOT NULL,
      `password` varchar(100) NOT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    
    
  • Step Eighth:

    Clone this repository and copy the registration folder to /var/www/html/

     sudo cp -r registration /var/www/html/
    
    
    • Step Nineth:

    Restart the apache server

    sudo systemctl restart apache2
    
    • Step Tenth: Open this URL in browser
    http://localhost/registration
    
    

## Click on sign up page to sign up for an account.

## Then sign back again with the username and password.

Top comments (2)

Collapse
 
martinspears profile image
martinspears

Step Eighth:

Clone this repository and copy the registration folder to /var/www/html/

what repository?

Collapse
 
priyaranjankumar profile image
Priya Ranjan Kumar • Edited

'repository' is the link to the git repo. BTW because of typo it was not visible.
Thanks for pointing it out