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", ...

Get Mastering HTML5 Forms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.