php Registration Form with Database Code: Signup Form in php, If you are a new PHP programmer or if you are not a PHP programmer, if you need an account system for your website, then there will be a need for a registration form. If you need something like this, you have come to the right place. If you read today’s article in its entirety then you can create a registration form for your website without any programming skills using PHP and Database Connection.
We need this registration form that time when we have create account system on our website. Registration form we can design or create HTML, CSS, JavaScript, but we also need php coding to make this registration form work. There are other languages that can do this. But today we will learn how to registration form working using php or Signup Form in php.
Also Read: php session Code not Working on Live Server – error Fix
Also Read: How to Increase your Website Loading Speed- Quick AdSense Approval
Hello friends, in today’s article we will learn how to create a registration form through php and how it works, how we can create it for users, etc. php Registration Form with Database Code.
Friends, since I have a live web hosting server, I will create this registration form in live web hosting server. If you do not have a live hosting server, you can create one on your computer’s localhost server and then upload it to your live hosting server as needed.
If you need, you can buy the fastest web hosting server from here at very low cost. Best Web Hosting for WordPress Cheap with Great Performance.
What the Registration form ? Register php
In a word, a registration form is a school or college or any other place where you can submit all your details so that the school, college or any other organization can know all about you. Nowadays this registration form is completely online. They can ask you for the things they need in the registration form.
Also Read: How to Increase Traffic on Blog Website 2022
Since different organizations may ask you for different things in their registration form according to their needs, these registration forms are different for different organizations. This means that different organizations make their registration forms differently according to their needs.
Usually these things are compulsory in a registration form like- name, father’s name, mother’s name, date of birth, gender, mobile number, email id, etc.
Why need registration from
We need to have user details when we create an account system website. If there is a problem in any of the cases then we collect the details of that user from here, we can solve that problem. Since the online registration system is a completely automated system, a registration form is required to store the details in the user database. For the purpose of storing users’ details in a database and allowing them to reuse.
We use this registration form to store the user’s user ID and password in the database for the user to access his account. So that the user can access his account with the user ID and password.
Create HTML Registration Form
Friends, since we learn how PHP of registration form works, we are not designing HTML form nicely. If you need, you can design your own HTML registration form with CSS.
Create Registration Form
Open your Notepad and save the page by using “registration.php” name
<center>
<h2>Registration Form</h2>
<form action="" method='POST'>
<input type="text" name='fullname' placeholder="Fullname !" required><br><br>
<input type="text" name='mobileno' placeholder="Mobile nNo !" required><br><br>
<input type="text" name='emailid' placeholder="Email id !" required><br><br>
<input type="text" name='password' placeholder="Password !" required><br><br>
<input type="text" name='rpassword' placeholder="Repeat Password !" required><br><br>
<input name='submit' type='submit' value='Register Now'>
</form>
</center>
Also Read: What is the ACD?- How Anti Collision Device works?

Create Database
Here I am manually making a data tablet. Below is a photograph of it. You can create a database by looking at it. First you create a database. I have created a database here called “user” and created a table called “userdetails“

This is the code to create MySQL database. If you want, you can copy this code and paste it in your Notepad, save it as SQL with a name and upload it to database and create userdetails table.
--
-- Table structure for table `userdetails`
--
CREATE TABLE `userdetails` (
`auto_id` int(11) NOT NULL,
`name` varchar(500) NOT NULL,
`mobileno` varchar(100) NOT NULL,
`emailid` varchar(500) NOT NULL,
`password` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Connect with database php code
When we submit the form with all the details in the register form, in order to save those details in the database, the database has to be connected with the form. php coding is required for this. The code is as follows-
Open your Notepad and save the page by using “config.php” name-
<?php
$servername = "localhost"; // DataBase Hostname
$username = "root"; // Database Username
$password = "pass123"; // Database password
$dbname = "user"; // Database name
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
mysqli_query($conn,'SET CHARACTER SET utf8');
mysqli_query($conn,"SET SESSION collation_connection ='utf8_general_ci'");
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
else
{
echo"OK";
}
?>
Create Registration Process Page
In this page we will be coding php all the codes from which the data will be saved by going to our database. Users will be able to access all that data with their user ID and password as required.
Open your Notepad and save the page by using “registration-process.php” name-
<?php
error_reporting(0);
include('config.php');
$fullname = $_POST['fullname'];
$mobileno = $_POST['mobileno'];
$emailid = $_POST['emailid'];
$password= $_POST['password'];
$rpassword = $_POST['rpassword'];
if($_POST['submit'])
{
if($password == $rpassword)
{
$sql = ("INSERT INTO `admission_registration`(`auto_id`,`name`,mobileno`,`emailid`,`password`)VALUES('0','$fullname','$mobileno','$emailid','$password')")or die(mysql_error());;
$result = mysqli_query($conn, $sql);
if($result===TRUE)
{
echo"Registration Successful";
}else{
echo"Error !";
}
}else{
echo"Password Not Match !";
}
}
?>
Friends, this is how to create a registration form using PHP coding. The password we used in this registration form is not encrypted. Since we are learning the basic concepts, we have not used encrypted passwords here. We will discuss password encryption in detail in another article.

Since encrypted password is a very important and sensitive thing, we will not be able to discuss it properly in this article.
The last few words
This is the most important and basic thing about a PHP registration envelope without which it is impossible to create a registration form. All programmers use this basic concept to design their registration form very nicely.
Friends, I hope that after reading this article in its entirety, you have fully understood how to create your registration form through php and how it works (php Registration Form with Database Code – Signup Form in php). I hope this article will help you to create a registration form for your website. If you have any coding problems with this form please let us know in the comment box and we will try to resolve your issue as soon as possible.