RESTful Post: Overview
Page 1
HTML, PHP, MySQL
This tutorial demonstrates how to use basic RESTful HTML post, with PHP and MySQL. The end result displays a Web page table derived from the posted MySQL data.
Steps to Implement
- Create a CSS3 style sheet with selectors, declaration blocks, properties and values.
- Create a Web page with a form and input data. Display the form with your style sheet.
- Create a MySQL database, table and columns. The columns correspond to the form's input data.
- The form, from item 2 in this list, has a
Post Data
button which links to a PHP file. - Implement functions in a PHP file that obtain the form's input data.
- The PHP file's functions connect to your database and table.
- The PHP file's functions insert, or update, fields in your table, using SQL statements.
- The PHP file's functions display an HTML table, with the database table's fields. Display the table with your style sheet.
- The PHP file closes the database connection.
Three Components: Same Fields
The HTML form's input name
values, ideally correspond
with the PHP $_POST
values, and the
MySQL table column
identifiers.
However you can give the MySQL table's identifiers different values.
It's just easier to understand when MySQL columns match
HTML form attributes and PHP variables.
In other words, all three components work together. The form works with PHP which works with MySQL.
Try It!
Try the Post to PHP example described in this tutorial.