Changes

Jump to: navigation, search

PHP and HTML Forms

3 bytes removed, 19:58, 7 June 2007
no edit summary
== Processing Form Data Using PHP ==
Now that we have created out a form we need to understand how to process the data enter by the user in our server side PHP script. There are two mechanisms for transmitted the data form an HTML form to the server, GET and POST. In our example above we specified POST, but in eiterh either case the task of reading this data in our PHP script is equally simple.
Essentially PHP places the data from the form into an associative array (for information on PHP arrays see [[PHP Arrays]]) which can be accessed from within the server side PHP script. For POST and GET the array variable names are $_POST and $_GET respectively.
For our example HTML form we can write a simple subscribe.php script to output the content of the $_POST methoid method when the form is submitted it to our web server:
<pre>

Navigation menu