php - 一个 phpnuke 网站

标签 php web

我有一个带有 phpnuke 的网站,但不是我创建的。但现在我负责了,也没用了。以前可以用,但现在不行了。

首先它没有出现。只是一张空白页。 我发现问题出在 mainfile.php

中的这一行
if (!ini_get('register_globals')) {
    @import_request_variables("GPC", "");
}

我刚刚对此发表了评论。现在是第一页,但它在页面顶部给了我这个警告

Strict Standards: Resource ID#10 used as offset, casting to integer (10) in /www/sites/sanad-rahbordi.sbu.ac.ir/httpdocs/db/mysql.php on line 212

Strict Standards: Resource ID#10 used as offset, casting to integer (10) in /www/sites/sanad-rahbordi.sbu.ac.ir/httpdocs/db/mysql.php on line 213

Strict Standards: Resource ID#10 used as offset, casting to integer (10) in /www/sites/sanad-rahbordi.sbu.ac.ir/httpdocs/db/mysql.php on line 212

Strict Standards: Resource ID#10 used as offset, casting to integer (10) in /www/sites/sanad-rahbordi.sbu.ac.ir/httpdocs/db/mysql.php on line 213

这是mysql.php中包含212和213行的函数

function sql_fetchrow($query_id = 0)
{
    if(!$query_id)
    {
        $query_id = $this->query_result;
    }
    if($query_id)
    {
        $this->row[$query_id] = @mysql_fetch_array($query_id); // 212
        return $this->row[$query_id]; // 213
    }
    else
    {
        return false;
}

我通过注释显示了 212 和 213 行。 那么问题出在哪里呢?我想不通。 我尝试将这两行中的 $query_id 替换为 (int)$query_id ,错误现在不会显示,但网站无法正常工作。我的意思是第一页出现,但是当我单击每个链接时,它只会出现 index.php。没有链接有效。

最佳答案

问题是,您尝试使用资源 ID 作为数组中的。 这是不可能的,因此 php 将资源 id 转换为整数。

如果您手动转换资源,这将起作用,并且 PHP 不会对此发出警告。 “@”隐藏“mysql_fetch_array”期间发生的任何错误。由于您想看到该错误,因此应该将其删除。

if($query_id)
{
    $intQueryId = (integer) $query_id;
    $this->row[$intQueryId] = mysql_fetch_array($query_id); // 212
    return $this->row[$intQueryId]; // 213
}

else 缺少一个“{”

    else
    {
      return false;
    }

关于php - 一个 phpnuke 网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14414201/

相关文章:

javascript - 如何避免在 http header 中显示表单数据

php - 保存从函数 imagecopy 创建的图像

php - while 循环中的多选查询

javascript - AngularJS Iframe 弹出窗口像 fancybox 一样?

html - 如何给表单框添加边框?

python - 如何使用 python 以编程方式从 MusicBrainz 检索编辑历史页面?

php - 在 php 中提交编辑表单后,日期返回 00 00 0000 值

php - mysql 查询 if 语句

asp.net-mvc - 如何使用 ASP.NET MVC 从另一个网页获取 "content = page source"?

python - 在 flask 中打印多张图像(每行)