In this lesson we'll explore ways to further validate inputting data.
We'll start with the pragmatic function we've added and you.
Else if statement to our previous document is shown here we can use the preg MATCH function to test
whether a string meets a specified pattern.
In our case we'll test to make sure that the name only contains letters in whitespace.
This will prevent someone from typing in numbers in the first name.
We've also added another else if statement using the preg MATCH function again this time it checks to
make sure the input in Web site is in the correct format.
For example w w w dot my website dot com would be an acceptable format so let's test our script out
to see the result.
We'll start by typing numbers in the first name so we can see that the error now Outputs Named can only
contain letters.
Now we'll type the wrong website format
so we can see the error website is in the wrong format.
And when the name contains only letters and the website is in the correct format we can see that the
submission works and the data is output.