Create Register form

vishwa dharmaratna
2 min readFeb 21, 2021

creating a form to submit data, explain the procedure how it get inputs and store the data in a database.

Moving data from a HTML structure into an information base is a two-venture configuration measure. To start with, make a section HTML structure able to do passing data to an auxiliary document. Then, make a Hypertext Preprocessor (PHP) document to acknowledge the information and addition it into the data set. HTML is just fit for educating a program on the strategy for introducing data. The exchanges expected to store data in the data set require Structured Query Language (SQL) orders set inside a PHP content

HTML

Create a Form on the Appropriate Page

Create a form on the appropriate page including the “action” and “method” attributes in the form definition tag

<form action=”insert.php” method=”post”>

The “action” attribute advises the structure to send the information to a content named “insert.php,” and “method” portrays the sort of activity to be performed once the data is passed to the content.

Define Input Fields

Define the input fields along with the data types to be passed to the database.

index.html

Create Submit Button

Provide the user with a way to initiate the transaction with the tag:

<input type=”submit” />

This displays a “submit” button at the bottom of the form that triggers the database transaction

PHP

Make a document named “insert.php.” Any record name can be utilized as long as it coordinates the name indicated by the structure’s “action” characteristic and closures with the .php extension.

insert.php

Connect to Database

You must create the database and tables before passing data to them. The table’s field names must match the names of the variables passed by the “$_POST[xxxxx]” global variables.

--

--