PHP: How to take and store user input
To add a field:
First, you need a form. Then you need a php file that will refer back to the html. For example in a folder you might have your index.html, then your outputPage.php. In the body of your index.html, you will place the form. Example:
<form action="outputPage.php" method="post">
An input is just what it sounds like: it allows the user to interact with/input stuff on a webpage. It's also used for making a submission button. The 'name' attribute is very important; it is a 'tag' that is used in the php page to refer back to that text from the html page.
Example:
Your name: <input type="text" name="name">
Putting things together, for the index.html, the contents between the <body></body> tags would look something like the following:
Code
1. <form action="outputPage.php" method="post">
2. Your name: <input type="text" name="name">
Output