replace
if (eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$",$_POST['email']) || empty($_POST['email'])){
with
if ( !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) || empty($_POST['email'])){
and replace
if (ereg('^[A-Za-z0-9@#$%^+=]{5,60}$',$_POST['password']) || !$cfg['md5passwords']){...