added a bunch of error message, and email validation for signup.php
moved logic to function.php