我试图在代码中插入一个常量定义,这样如果有$ error [],就可以插入对应的define字符串。就我而言:
if($user->login($username,$password)){
header('Location: memberpage.php');
$_SESSION['user_name'] = $username;
exit;
} else {
$error[] = 'Wrong username or password or your account has not been activated.';
}
定义常量
define ('ERROR_LOGIN', 'Wrong username or password or your account has not been activated.');
如何在$ error []之后插入ERROR_LOGIN,以便在条件为假的情况下我将返回其余部分?
感谢您的帮助