<?php
/*===================================================+
|| # HoloCMS - Website and Content Management System
|+===================================================+
|| # Copyright © 2008 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|+===================================================+
|| # HoloCMS is provided "as is" and comes without
|| # warrenty of any kind. HoloCMS is free software!
|+===================================================*/

include('../global.php');
$email = Filter($_POST['email']);
$email_check = preg_match("/^[a-z0-9_\.-]+@([a-z0-9]+([\-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i", $email);
$check = mysql_query("SELECT id FROM users WHERE mail = '".$email."' LIMIT 1") or die(mysql_error());
				$row = mysql_num_rows($check);
				if($row > 0){
	echo "register.message.invalid_email";
} elseif($email_check !== 1){
	echo "register.message.invalid_email";
} else {
	header("X-JSON: \"emailOk\"");
	echo "register.message.email_chars_ok";
}

?>

