Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

censoring

Status
Not open for further replies.

calv1n

Programmer
Sep 29, 2007
18
CA
I'm using this code to censor my message on my site:

Code:
	$fp = fopen("banned.txt","r");
	while($word = fgets($fp,10000)) {
		$str3 = ereg_replace(trim($word),"<censored>",$str3);
	}

Right now the word list are stored on a text file delimited with line breaks. I'm changing it to mysql. The words are stored in a mediumtext field also delimited by line breaks. My question is-- how can I change the code to getting the word list from mysql instead of the file?

Thank you.



-CALV1N
 
if you're using php5 then this is a perfect application for sqlite.

it's also not clear to me whether you are asking for help in getting the words into a database or checking whether words are censored against the list on your website. i'd guess the latter

The words are stored in a mediumtext field also delimited by line breaks
i have a horrible suspicion that you might be putting all the words into a single field. i would recommend going to talk to those nice folks in the mysql forum for a better schema.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top