ログイン後の自動登録を誰かが手伝ってもらえますか?これが私の登録スクリプトです...
if (empty($_POST) === false) {
$required_fields = array ('email', 'username', 'password', 'password_again', 'first_name', 'last_name');
foreach ($_POST as $key=>$value) {
if (empty($value) && in_array($key, $required_fields) === true) {
$errors [] = 'ALL fields MUST be filled out correctly';
break 1;
}
}
if (empty($errors) === true) {
if (user_exists($_POST['email']) === true) {
$errors [] = 'Sorry, the email \'' . $_POST['email'] . '\' is already in use.';
}
if (preg_match("/\\s/", $_POST['email']) == true) {
$errors[] = 'Your email must not contain any spaces';
}
if (user_exists($_POST['username']) === true) {
$errors [] = 'Sorry, the username \'' . $_POST['username'] . '\' is already in use.';
}
if (preg_match("/\\s/", $_POST['username']) == true) {
$errors[] = 'Your username must not contain any spaces';
}
if (strlen($_POST['password']) < 6) {
$errors[] = 'Your password must be in between 6-24 characters long';
}
if ($_POST['password'] !== $_POST ['password_again']) {
$errors[] = 'Your passwords did not match';
}
}
}
?>
このコードはユーザーを登録するだけで、私もログインしたいのですが、これをひどく評価することはできませんか?