ログインページを作成していますが、それをロードすると、次のエラーが表示されたようです。
致命的なエラー: 行 4 の /home/a4625512/public_html/core/functions/general.php で email() (以前は /home/a4625512/public_html/core/functions/general.php:2 で宣言されていました) を再宣言できません
私のホストは 000WebHost なので、関係があるかどうかはわかりません。オンラインでどこでも検索しました。
general.php コード:
function email($to, $subject, $body) {
mail($to, $subject, $body, 'From: hello@points4u.com');
}
ログインコード:
include 'core/init.php';
if(empty($_POST) === false){
$username = $_POST['username'];
$password = $_POST['password'];
if(empty($username) === true || empty($password) === true){
$errors[] = 'You need to enter a username and password.';
}else if(user_exists($username) === false){
$errors[] = 'We cant find that username. Have you registered?';
}else if(user_active($username) === false){
$errors[] = 'You have not activated your account!';
}else{
$login = login($username, $password);
if($login === false){
$errors[] = 'That username/password is incorrect.';
}else{
$_SESSION['user_id'] = $login;
header('location: index.php');
exit();
}
}
print_r($errors);
}