In the future use the PHP tags when posting, it makes reading your code much easier. Also, if you have an error on a particular line it helps if you indicate which line it is in your code.
The error is on this line:
PHP Code:
if (!eregi("([^A-Za-z0-9]"),$test)) {
You put one of the regex parens outside of the quotes. Try:
PHP Code:
if (!eregi("([^A-Za-z0-9])",$test)) {
Also, ereg functions have been deprecated. You should be using preg functions.
PHP Code:
if (!preg_match("/([^A-Za-z0-9]/i"),$test)) {
Last edited by NullPointer; 10-19-2011 at 09:36 AM..
|