there is a selection of form validation you can use such as eregi and preg match which can validate the info submitted via a form. You also need to consider mysql escape string for secuity against sql injection. Security is such a massive issue and should be your main priority when designing a script.
One such email validation checker I have used is
if(preg_match('/^[\w]+[-\w._]*@[\w]+[-\w]+(\.[\w]+[-\w]+)*\.[\w]{2,6}$/ ', $_POST['email']))
this checks the correct syntax of the form submitted email address.
A further example is checks if the username has characters lowercase or uppercase plus numerical characters, or you can initiate an error, there are many out there
if(preg_match('/^[a-zA-Z0-9_-]{4,}$/i', $_POST['username'])){
.
See (regex) php cheat sheet for some guidance.