Hallo!
Ok, danke euch beiden. Ich habe einige Fehler reingebaut, die nicht hätten sein müssen. Diese habe ich jetzt verbessert. Aber es klappt immer noch nicht. Warscheinlich wegen dem Array. Hier mein Code:
class CheckString {
var $words = array('<a', '\[link', '\[url');
var $punkte = null;
function wordsLength() {
return count($this->words);
}
function checkData($data) {
for($i = 0; $i < $this->wordsLength(); $i++){
if( eregi($this->words[i], $data)){
$this->punkte = $this->punkte + 1;
}
}
return "Ihr Eintrag enthält ".$this->punkte." von den ".$this->wordsLength()." verbotenen Wörtern! Bitte löschen Sie diese.";
}
}
$text = "<a test test";
$check = new CheckString();
print $check->checkData($text);
Die Fehlermeldung lautet:
#########################
Warning: eregi() [function.eregi]: REG_EMPTY in D:\xampp\xampp\htdocs\checkString.php on line 14
Warning: eregi() [function.eregi]: REG_EMPTY in D:\xampp\xampp\htdocs\checkString.php on line 14
Warning: eregi() [function.eregi]: REG_EMPTY in D:\xampp\xampp\htdocs\checkString.php on line 14
Ihr Eintrag enthält von den 3 verbotenen Wörtern! Bitte löschen Sie diese.
#########################
Jetzt gehe ich erst mal eine Runde schlafen, damit ich morgen wieder fit bin ;-) Vielen Dank!
ciao, ww
--
Ein japanisch-deutsches Gedicht
sh:( fo:| ch:~ rl:( br:> n4:~ ie:% mo:) va:) de:] zu:) fl:( ss:| ls:~ js:)
Ein japanisch-deutsches Gedicht
sh:( fo:| ch:~ rl:( br:> n4:~ ie:% mo:) va:) de:] zu:) fl:( ss:| ls:~ js:)