In this article we will learn about some of the frequently asked Php programming questions in technical like Creating a user registration System Using PHP and Mysql.. When creating scripts and web applications, error handling is an important part. If your code lacks error checking code, your program may look very unprofessional and you may be open to security risks. Error handling in PHP is simple. An error message with filename, line number and a message describing the error is sent to the browser. This tutorial contains some of the most common error checking methods in PHP. Below are some solution about 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
-
Step Second:
Install MySql using this command.
sudo apt-get install mysql
-
Step Third:
Install MySql-Client using this command.
sudo apt-get install mysql-client
-
Step Fourth:
Install PHP and MySql Connector.
sudo apt-get install php-mysql
-
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 Seventh:
-
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.