There is a huge amount of info/examples on the internet showing how to validate form data using php. Basically you can use a combination of regular expressions and built-in php functions to validate common form data like email addresses etc.
If you google something along the lines of ‘form validation php’ I’m sure you will get lots of hits.