coppermine-gallery.com/forum

Support => Older/other versions => cpg1.1d PHPnuke Support (deprecated) => Topic started by: tkx on November 08, 2003, 09:08:40 AM

Title: Notice: Undefined index: 1 in /path/mainfile.php on line 202
Post by: tkx on November 08, 2003, 09:08:40 AM
I get this error whenever I run coppermine.... I checked the reference, and the part in the code is highlighted in red... Any1 else have this problem, or else know how to fix it without impacting the rest of the site (bearing in mind that it is the mainfile.php).  Powered by Coppermine Photo Gallery v1.1  Version for phpnuke by Surf v1.1D

Quotefunction is_admin($admin) {
    global $prefix, $db;
    if(!is_array($admin)) {
        $admin = base64_decode($admin);
        $admin = explode(":", $admin);
        $aid = "$admin[0]";
        $pwd = "$admin[1]";
    } else {
        $aid = "$admin[0]";
        $pwd = "$admin[1]";
    }
    if ($aid != "" AND $pwd != "") {
        $sql = "SELECT pwd FROM ".$prefix."_authors WHERE aid='$aid'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $pass = $row['pwd'];
        if($pass == $pwd && $pass != "") {
            return 1;
        }
    }
    return 0;
}
Title: Notice: Undefined index: 1 in /path/mainfile.php on line 202
Post by: DJMaze on November 08, 2003, 09:50:29 AM
Did you add additional modules to your phpNuke installation ?
Also which version of phpNuke ?
Title: Notice: Undefined index: 1 in /path/mainfile.php on line 202
Post by: sengsara on November 10, 2003, 02:29:19 AM
You need to answer this question:
QuoteDid you add additional modules to your phpNuke installation ?
Also which version of phpNuke ?
After that try this
$pwd = "$admin['1']";
Title: Notice: Undefined index: 1 in /path/mainfile.php on line 202
Post by: DJMaze on November 10, 2003, 04:24:09 AM
Quote from: "sengsara"After that try this
$pwd = "$admin['1']";

$pwd = "{$admin['1']}"; cos array values need to be between brackets  :wink: