In this part of the course we're going to be discussing how to process each team malformed data using
P HP the concepts explored here are very important because web pages interact with users using forms
form data can be used for many things we can insert data into a database we can email form data to our
users such as a confirmation email or a thank you note we can also use form data to perform arithmetic
or perhaps a combination of any of these purposes
form processing starts as soon as we fill out an HMO form and click the Submit button
at this stage in the course you should be familiar with creating HMO forms we know that the form element
has an action attribute in our HMO course we did just about everything except assign a value to our
action attribute it's the action that brings our form to life the action of our form will point to a
BHP script in addition to instructing our server on what to do with the form data the HP script can
also validate the form.
This means we can check things that email addresses or phone numbers to make sure they're in the right
format we can also check to make sure that form inputs are not left empty or put limits on how much
data can be input.
These are just a few examples BHP form validation is done on the server meaning it's the most effective
form validation available.
We did some javascript validation in the javascript course but we also pointed out that JavaScript can
be turned off by the user because it's a client side.
Programming Language not a server side.
P P validation cannot be turned off making it the safest way to test form inputs for data accuracy
we'll be exploring two ways to transmit data to our form to our HP script from our each general form
the get method in the post method in both methods the data is transmitted in an array that is automatically
generated the Array holds the key and value pairs the keys are the name of the form controls and the
value is the data encoded by the user we'll come back to this when we start creating our form there's
some important points to note about post first get before we begin
the get method passes our array variables through the you are a parameter
the get method should only be used for sending non sensitive data never send passwords through the get
method all variables are displayed openly in the you are all the get method has limits on how much information
can be sent the current limit is two thousand characters
now the post method passes variables using the H TTP post method the post method is much more secure
because variables are not displayed in the U R L information that is passed is invisible to others because
it's embedded within the body of the HDTV request it has no limits as to the amount of information we
can send and this method is performed preferred by developers.