Possible Duplicate:
How can I convert ereg expressions to preg in PHP?
My contact form is othervise working but I keep getting the following error:
Deprecated: Function ereg() is deprecated in/home/.....
I'm really lost here but I figure this is the part that needs some adjusting.
if ( empty($_REQUEST['name']) ) {
$pass = 1;
$alert .= $emptyname;
} elseif ( ereg( "[][{}()*+?.\\^$|]", $_REQUEST['name'] ) ) {
$pass = 1;
$alert .= $alertname;
}
if ( empty($_REQUEST['email']) ) {
$pass = 1;
$alert .= $emptyemail;
} elseif ( !eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z] {2,3})$", $_REQUEST['email']) ) {
$pass = 1;
$alert .= $alertemail;
}
if ( empty($_REQUEST['message']) ) {
$pass = 1;
$alert .= $emptymessage;
} elseif ( preg_match( "[][{}()*+?\\^$|]", $_REQUEST['message'] ) ) {
$pass = 1;
$alert .= $alertmessage;
}
Finding a solution would be highly appreciated