if($surname ==""){
$error = "You must provide a surname";
}
if($first_name ==""){
$error = "$error <br>You must provide a first name";
}
if($street_address ==""){
$error = "$error <br>You must provide a street address";
}
if($phone ==""){
$error = "$error <br>You must provide a phone number";
}
//Convert phone number to numbers (remove spaces, dashes, periods, etc.)
//Takes numbers with alpha characters into consideration
$phone = str_replace(array(' ', '-', '.', '(', ')', '!', '@', '#', '$', '%', '^', '&', '*', '_', '=', '+'), '', $phone);
if ( strlen($phone) > 10 ){
$error = "$error <br>Your phone number cannot be more than 10 numbers";
}
if(is_numeric($phone)==0){
$error="$error <br>The phone number must only contain numbers"; |