Php 登录页面显示空白
我目前正在修复的项目的登录页面显示为空白。我试着重复一些词来找出错误所在。我发现注释掉下面的代码使它显示出来Php 登录页面显示空白,php,Php,我目前正在修复的项目的登录页面显示为空白。我试着重复一些词来找出错误所在。我发现注释掉下面的代码使它显示出来 elseif( isset($_POST['do_login'] ) ){ //Login user $email = (isset($_POST['login']) && is_string($_POST['login']) && strlen($_POST['login'])<100)?$_POST['l
elseif( isset($_POST['do_login'] ) ){ //Login user
$email = (isset($_POST['login']) && is_string($_POST['login'])
&& strlen($_POST['login'])<100)?$_POST['login'] : null;
$password = (isset($_POST['password']) && is_string($_POST['password'])
&& strlen($_POST['password'])<100)?$_POST['password'] : null;
$remember = isset($_POST['chkremember']) ? true : false;
$result = $auth->login($email, $password, $remember);
switch($result){
case 1:
$msg = 'You have successfully logged in.'
break;
case 2:
$msg = 'Your account has not yet been confirmed. <br/> Please check the e-mail message sent by us and click the confirmation code to validate this account. <a href="user_login.php?view=resend&resend_email='.$email.'">resend activation e-mail</a>';
break;
case 3:
$msg = 'Your account is not enabled!';
break;
case 4:
$msg = 'Account with given login credentials does not exist!';
break;
}
}
elseif(isset($\u POST['do\u login']){//login user
$email=(isset($\u POST['login'])和&is_string($\u POST['login']))
&&strlen($_POST['login']))
分号在中断前丢失
分号在破译前丢失;在案例1
中,您在破译前丢失了;
在案例1
中,您在破译前丢失了;
您所说的“空白”是什么意思?完全白色页面?如果是,请查看您的错误日志。打开php.ini文件中的错误,您将看到问题所在。似乎缺少代码!您从elseif
开始。我打赌$u POST['do\u login']未设置。最好的方法是打印($\u POST)此外,这段代码设置了变量$msg,但当$msg=1(登录确定)时,似乎没有打印任何内容。在您发布代码之后,可能还会有一些php。您所说的“空白”是什么意思?完全白色页面?如果是,请查看您的错误日志。打开php.ini文件中的错误,您将看到问题所在。似乎缺少代码!您从elseif
开始。我打赌$u POST['do\u login']未设置。最好的方法是打印($\u POST)此外,这段代码设置了变量$msg,但在$msg=1(登录确定)时似乎不打印任何内容。在你发布你的代码之后,可能会有更多的php。谢谢你修复了这个问题。我在试图修复脚本的更大问题时忽略了这个问题。如果你愿意帮助我解决我在脚本中遇到的更大问题,请看这个问题。谢谢你修复了这个问题。我在尝试修复scr的更大问题时忽略了这个问题ipt…如果您想帮助我解决此脚本的更大问题,请查看此问题
case 1: $msg = 'You have successfully logged in.' break;