How to Transfer Data in Web Form to a Database

Written by cristina puno
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Transfer Data in Web Form to a Database
You can connect online forms to databases using form handling scripts. (online vote image by Matteo Gamba from

When collecting data from a web form, there are several options available to a web developer. One option is to display the data on a webpage. Another is to have it sent to an e-mail address. One of the best options available is to transfer the data on the form to a database. Not only will it allow more data to be collected, but it also lets you store and organise the data in a way that facilitates better data retrieval.

Skill level:

Things you need

  • HTML editor
  • PHP or ASP Web hosting account

Show MoreHide


  1. 1

    Create a database. Note down the input fields on your existing web form. For example, if your form contains fields for "Name," "Address," "Email" and "Phone Number," create these corresponding fields in your database.

  2. 2

    Create a form handling page. This will contain scripts that will connect the web form to your database and store the entered information. You will need to use programming languages such as ASP or PHP along with SQL to create a script to have the data stored in your database.

  3. 3

    Edit your web form. Using an HTML editor such as MS Frontpage or Dreamweaver, change your "<form>" tag to submit to your form handling page. For example, if your form handling page is named "formhandler.php," the "<form>" tag will look like this:

    <form name="input" action="formhandler.php" >

  4. 4

    Save your web form and form handling page and upload it to your web hosting account.

Tips and warnings

  • You can also add form validation scripts on your web form using JavaScript. This will create less errors when transferring the data from a web form to a database. Data is checked if it is a valid input, such as checking if numbers are typed in for phone numbers or a valid e-mail address is entered for the email address field. Some HTML editors, such as Dreamweaver, have the functionality to let you add this automatically.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.