Site icon A5THEORY

User Registration Form Using PHP & HTML.

user-registration-form

Hello Friends, In this blog post(User Registration Form Using PHP & HMTL), I will explain to you how to make a simple user registration form using PHP. / How do PHP and HTML work together?

Registration form(User Registration Form Using PHP & HMTL) is a very important function when you have a user account facility on your website,

whether it is for subscription-based service or selling a product|User Registration Form Using PHP & HMTL|

The registration form(User Registration Form Using PHP & HMTL) may have several variations you can have registration from your employee.

Registration and Login form in PHP and MySQLi with validation, Student registration form in PHP code with validation with HTML code|User Registration Form Using PHP & HMTL|

Within this blog, you will learn How to link my signup form to my database. How do I create a login and signup page in HTML? Student registration form in PHP code with validation.

In this Registration form, the User will enter the username and password in a form and will submit their data to your database|User Registration Form Using PHP & HMTL|

This will help them to log in to their account on your website as their username and database will be stored in your database.

You can see the below image for the user registration form.


The software used for building this functionality is given below:

Install NetBeans IDE
Install Xampp Server


What is the procedure for making this user registration form functional?

this is a very simple function to build a beautiful user registration form, you just need to follow the step-by-step procedure given below.

First, open the Netbeans IDE.

Start the Apache server and MySql server using Xampp.

If you don’t know how to start Xampp Server then please go through this link.

Now create a database name as a test.

Create a table name as log-in with two fields, username, and password.

Now create a new project in your NetBeans IDE as User_Registration though you can have a name as per your wish.

Now create a few more files as shown in the below image.

Once you create all the files then just copy and paste the below code one by one in the respective files.

index.php:

[code php]
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link href="formregister.css" rel="stylesheet" type="text/CSS"/>
</head>
<body>
<h3>Registration Form</h3>
<form action="#" method="get" id="register form">
<input type="text" name="username" placeholder="UserName"></input><br/>
<input type="password" name="password" placeholder="PassWord"></input><br/>
<input type="submit" name="submit" value="Submit"></input>
</form>

<?php
if (ISSET($_GET['submit'])) {
$con = mysql_connect("localhost", "root", ");
//Selecting Database
$db = mysql_select_db("test", $con);

$username = $_GET['username'];
$password = $_GET['password'];

if($username==""||$password=="")
{
echo"Please fill all the fields";
}
else{

$query=mysql_query("insert into login (username, password) values ('$username','$password')");
echo"Your data has been submitted successfully";

mysql_close($con); // Closing the connection
}

}
?>
</body>
</html>
[/code]

formregister.css:

[code css]
#registerform{
text-align: center;
border:1px solid #ccc;
width:300px;
padding:0 50px 15px;
margin-top:20px;
box-shadow:0 0 15px;
border-radius:6px;
float: left;
background color: light gray;
margin-left: 475px;

}
input[type="submit"]{
width:100%;
padding:10px 45px;
background-color:#2BC1F2;
border: none;
color:#fff;
font-size:18px;
font-weight:700;
cursor: pointer;
font-family: 'Spectral', serif;
margin-left:10px;

}
input[type="text"]{
width:100%;
margin-top:10px;
height:35px;
margin-bottom:25px;
padding:10px;
border:3px solid darkslateblue;
}
input[type="password"]{
width:100%;
margin-top:10px;
height:35px;
margin-bottom:25px;
padding:10px;
border:3px solid darkslateblue;

}
h3{
text-align: center;
}
[/code]

Now run your project and you will get a registration form ready for your users.


Check out this amazing PHP login form with a proper installation guide.

simple PHP login form

You can also go through a few related blog links:

User Registration Form Using PHP & HTML…

PHP Email Verification Script For Downloading E-Book…

Login Form: Simple PHP Login Form With Session…

How to Show Progress Bar On Form Submission Using JQuery…

Make Your First PHP Program…

How to install XAMPP Server on your local computer…

Conclusion:

We have learned lots of things like Can you combine HTML and PHP? How do I link my signup form to my database? How do I create a login system? How do I create a login and signup page in HTML? How do you pass form data from one page to another by getting and POST in PHP? How to connect the HTML register form to the MySQL database with PHP? How to run PHP code in the HTML file? How can I use HTML and PHP together? It was amazing to see the user or student registration form together with PHP and HTML|User Registration Form Using PHP & HMTL|

In case of any queries, you can write to us at a5theorys@gmail.com we will get back to you ASAP|User Registration Form Using PHP & HMTL|

Hope! you would have enjoyed this post User Registration Form Using PHP & HMTL.

Please feel free to give your important feedback in the comment section below.

Have a great time! Sayonara!

Exit mobile version