I am finishing up this website and working on the last couple validations. How can I make the validation for a name field only accept letters and not numbers. And how can i validate a zip code field to contain exactly 5 digits. Below is what I have so far.
//First Name
function check_fname($fname){
if($fname==''){
return 'Please Enter your First Name.';
}}
//Zip Code
function check_zip($zip){
if(! is_numeric($zip)){
return 'Please Enter your Zip.';
}}
if ( ! is_zip_valid($zip) ){ /* add error message to container */ }