PHP Logout 500错误

时间:2017-03-13 17:52:38

标签: php html5 error-handling

执行注销脚本时出现500内部服务器错误。检查错误日志并找到了这个。

错误是:

  

../../ logout.php可以按组写入。参考:../../ user-dashboard.php

logout.php代码是

<?php       

require_once('session.php');
require_once('class.user.php');
$user_logout = new USER();

if($user_logout->is_loggedin()!="")
{
    $user_logout->redirect('user-dashboard.php');
}
if(isset($_GET['logout']) && $_GET['logout']=="true")
{
    $user_logout->doLogout();
    echo '<script language="javascript">';
    echo "if (window.confirm('Successfully Logged Out ! ')) 
            {
                window.location.href='login.php';
            };";            
    echo '</script>';
}

?>

user-dashboard.php

<?php

require_once("session.php");
require_once("class.user.php");
$auth_user = new USER();


$user_id = $_SESSION['user_session'];

$stmt = $auth_user->runQuery("SELECT * FROM user_credentials WHERE user_id=:user_id");
$stmt->execute(array(":user_id"=>$user_id));

$userRow=$stmt->fetch(PDO::FETCH_ASSOC);

?>

似乎无法从这些代码中找出错误。亲切的协助将不胜感激。该脚本在测试时可以在XAMPP上完美运行,但会在实时服务器上抛出错误。

1 个答案:

答案 0 :(得分:0)

想出来。我只是将权限代码更改为644