gpt4 book ai didi

php - PHP注销500错误

转载 作者:行者123 更新时间:2023-12-03 09:13:18 25 4
gpt4 key购买 nike

执行注销脚本时出现500 Internal Server Error。检查错误日志并找到了。

错误是:

../../logout.php is writeable by group. refer: ../../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上完美运行,但会在实时服务器上引发错误。

最佳答案

弄清楚了。我只是将权限代码更改为644

关于php - PHP注销500错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42770260/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com