PHP Form Validation Using Expected String

Hey, I am running a simple form validation, I am using a exp string for the Name area. The problem is I can’t seem to let it work properly with 2 or 3 last names. How is it possible I have tried all sorts.

Thanks,

[php] $string_exp = “/^[A-Za-z.’-]+$/”;
if(!preg_match($string_exp, $name)) {
$error_message .= ‘The Name you entered does not appear to be valid.
’;
}[/php]

what kind of error are you getting?

I don’t get an error however it doesn’t let the user type in a first and last name how can I add a space and re letters into the string?

Sponsor our Newsletter | Privacy Policy | Terms of Service