It is time to use the skills you have obtained over the last few articles. In this article we’ll use PHP and an HTML form to collect data from the user, store it in variables and then process it using PHP. As this is your first go we will use a simple example and move on to greater things!
Creating the HTML form
In previous articles, we talked about PHP and its syntax, created a working script, executed it and looked at variables. Now lets put some of this to use and create an HTML form that we will use to collect input from the user. We’ll then use variables to store the input from the user and then perform awesome tricks with it using PHP.
We’ll create a web page that takes a message from the user and shows it on a different page.
Lets begin with the HTML page that’ll contain the form. Call it “message_form.html” - if you want to call it something else, you may! For easy reading see this paste bin .
What is your name?:
What is your message?