O'Reilly logo

Mastering HTML5 Forms by Gaurav Gupta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Linking a form to a server

The basic purpose of form is to accept user data or store data from the users, which can be accessed in various ways, such as a survey, a new registration, while making payments, and much more. So here, in this section, we will learn how to store the user's input data into the database.

We will reuse our form which we styled in Chapter 3, Styling the Forms.

We will store the form data into a MySQL database using phpMyAdmin (open sourcetool to handle the administration of MySQL over World Wide Web).

For operating systems such as Linux, we use a XAMPP server.

The following is the server-side scripting code written in the same HTML page but the HTML file extension .html is changed to .php:

<?php mysqli_connect("localhost", "root", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required