READING INPUT FROM A FORM

$_POST

That's your new best friend (unless you use the GET method).

Let's assume that somebody has entered some text into a form you created on your initial HTML page, and that you named the 2 text fields "name" and "email".

The PHP page that is defined in the action of the form can print this info with this code:

echo "Hello $_POST[name]
";
echo "Your address is $_POST[email]";

Pretty simple. What's going on here is that when you send info in a form using the POST method, the information is stored in the $_POST SUPERGLOBAL, which in essence is really an associative array. There are two KEYS (name, email) and each one has one VALUE (Bob, This email address is being protected from spambots. You need JavaScript enabled to view it.). When the submit button was hit, the "action" told the server to go to the PHP page. Tagging along for the ride, is a little package called $_POST. When $_POST lands on the PHP page, you can ask him about the KEYS he has. He'll tell you the values associated with them. From there you can use them how you like. You could even have them be the default value of a text field in an additional form.