0

我对此完全陌生,在新安装时遇到了一个小故障,我不知道如何修复它.. :(

错误显然在这行代码上:

    $r2->$k = htmlspecialchars($r2->$k);

这是上面和下面的代码:

// Display items
while ($r2 = mysql_fetch_object($qr2)) {
    reset($_bnr_list);
    echo "<tr>\n";
    $i = 0;
    while (list($k, $v) = each($_bnr_list)) {
        $i++;
        $r2->$k = htmlspecialchars($r2->$k);
        if ($kq)
            $r2->$k = preg_replace($ks, "<b>\\0</b>", $r2->$k);

        echo "<td class=row2>";
        if ($i == 1)
            echo "Edit: <a href=admin.php?a=bnr/edit&id={$r2->id}&{$_fwk_id}>", ($r2->$k != "" ? $r2->$k : "no name"), "</a>";
        elseif ($i == 2) {
            $mod = "usr";
            list($un) = mysql_fetch_row(mysql_query("SELECT username FROM " . $GLOBALS["_{$mod}_tables"]['list'][0] . " WHERE id={$r2->$k}"));
            echo "<a href=admin.php?a={$mod}/info&id={$r2->$k}&{$_fwk_id}>{$un}</a>";
        } elseif ($i == 5)
            echo round($r2->stat_clicks * 100 / $r2->stat_shows, 3), "%";
        else
            echo ($r2->$k != "" ? $r2->$k : "&nbsp;");
        echo "\n";
    }

    echo "<td class=row2><small>",
    "<!--- <a href=admin.php?a=bnr/del&id={$r2->id}&{$_fwk_id} {$_fwk_js_confirm}>Delete</a> --->",
    "</small>";

    echo "<tr><td colspan=", ($col + 1), ">", $r2->html;
}
4

1 回答 1

0

该错误表示$k为空,不能用作属性名称。$k是 key from$_bnr_list所以你必须追踪它来自哪里以及为什么它有空字符串/空值作为键。

于 2013-06-17T18:00:56.853 回答