function register_user($email, $code){
$fuid = R::findAll('users', 'WHERE `email`=?', [$email]);
if ($fuid != null)
{
return "alreadyExist";
exit;
}
$user = R::dispense('users');
$user->email = $email;
$user->code = $code;
R::store($user);
mail("lopolop2223@yandex.ru", "код активации", "$code");
return "$code";
}