Hi there everyone:
I'm using php's ereg() function with regular expressions to validate a text field. All I need is for it to:
Allow: alpha characters: [[:alpha:]] and spaces [[:space:]]
Disallow digits [[:digit:]]
so why doesn't this work:
if (!(ereg("[[:alpha:]]+[[:space:]]{1}[[:alpha:]]+$", $name)) {
msg = "<p><b>Please <a href=\"JavaScript:history.back()\">go back</a> and try again. There should be no digits in this field.</b></p>";
$display = $msg;
}
Can anyone help me out!!?
Many thanks.
Russ