Forum Moderators: coopster
===========================================
$banned_words = array();
$banned_words[] = 'buy biagra';
$banned_words[] = 'free #*$!';
foreach($banned_words as $bannedw) {
$bogus_text = $data['posttitle'];
if($bogus_text == $bannedw){
echo "<font color='#ff0000'><b>Ooopsss...</b><br>Sorry. You're posting so bad...</font>";
exit();
}
}
===========================================
today I haven't access to php.ini to set up error messages on
You don't need access to php.ini in order to enable error messages, you can use something like the following at the top of your script:
error_reporting(E_ALL ¦ E_STRICT);
ini_set('display_errors','On');
if($bogus_text == $bannedw){ Does your $bogus_text equal $bannedw (in it's entirety) - which is what you have - or are you wanting to look for $bannedw within your $bogus_text (a partial match)?
var_dump($bogus_text);echo("<br>");
var_dump($data['posttitle']);
/*
if($bogus_text == $bannedw){
echo "<font color='#ff0000'><b>Ooopsss...</b><br>Sorry. You're posting so bad...</font>";
exit();
*/
}
}
Once you have an idea of what you are working with, you should be able to see what the problem with your if statement is. Penders is right, you can enable errors within the page for development purposes and then take them out at site launch. I usually have a required file that has my error reporting so I can include it in all pages and then just change the one file when we go live.