View Single Post
Old 10-14-2009, 12:08 AM   #2 (permalink)
adamdecaf
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

Correct me if I'm wrong but not all browses seem to send a undefined value for blank form fields, some tend to send '' (aka, nothing [blank string]).

PHP Code:
function is_empty($value){
    if (
$value === '' || empty($value)){
         return 
false;
    }
return 
true;
}

if (
is_empty($firstname) || is_empty($lastname) || is_empty($emailaddress)) {
            
$message "Please fill in all fields!";
        } else { 
__________________
My Site
adamdecaf is offline  
Reply With Quote