Mein Hoster hat mich heute drauf aufmerksam gemacht, dass ich zu viele Fehlermeldungen bei Seitenaufrufen generiere (über 1000 pro Woche)
Der großteil der Fehlermeldungen sehen wie folgt aus (sinnvoll gekürzt ;)):
1 | [Sun Sep 16 00:05:50 2007] [error] [client xxx.xxx.xxx.xxx] PHP Notice: Undefined index: antispam in .../include/includes/func/allg.php on line 315, referer: .../index.php?forum |
Der Fehler tritt also an folgender Stelle im Code auf:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | function get_antispam ($m, $t) { global $allgAr; if (is_numeric($allgAr['antispam']) AND has_right($allgAr['antispam'])) { return (''); } if (!is_array($_SESSION['antispam'])) { // <------------ HIER! $_SESSION['antispam'] = array(); } $_SESSION['antispam'][$m] = array(); $zeichen = array ('+', '-'); mt_srand((double)microtime()*1000000); $z = $zeichen[mt_rand(0,1)]; mt_srand((double)microtime()*1040404); $i1 = mt_rand (2,8); switch ($z) { case '+' : $i2_2 = 9 - $i1; break; case '-' : $i2_2 = $i1 - 1; break; } mt_srand((double)microtime()*1059595); $i2 = mt_rand (1,$i2_2); if ($z == '+') { $e = $i1 + $i2; } else { $e = $i1 - $i2; } $za = array ('+' => 'plus', '-' => 'minus'); $_SESSION['antispam'][$m] = array($i1, $za[$z], $i2); $rs = '<span style="display: inline; width: 100px; vertical-align: middle; text-align: center; background-color: #000000; border: 0px; padding: 2px; margin: 0px;"><img src="include/images/spam/z.php?m='.$m.'&w=0&'.session_name().'='.session_id().'" alt=""><img src="include/images/spam/z.php?m='.$m.'&w=1&'.session_name().'='.session_id().'" alt=""><img src="include/images/spam/z.php?m='.$m.'&w=2&'.session_name().'='.session_id().'" alt=""><img src="include/images/spam/ist.jpg" alt=""><input name="antispam_e'.$m.'" value="'.md5($e).'" type="hidden" /><input name="antispam" size="1" maxlength="1" style="background-color: #FFFFFF; border: 0px; margin: 0px; padding: 0px;" /></span>'; if ($t == 0) { return ($rs); } elseif ($t == 1) { return ('<tr><td class="Cmite">Antispam</td><td class="Cnorm">'.$rs.'</td></tr>'); } elseif ($t > 10) { return ('<label style="float:left; width: '.$t.'px; ">Antispam</label>'.$rs.'<br />'); } else { return (''); } } # antispam |
Ich hoffe ihr könnt mir weiterhelfen ^^
verwendete ilchClan Version: 1.1
betroffene Homepage: ungodly.de.vu/