Word filter problem


Posted on 16th Feb 2014 07:03 pm by admin

Hello,

im trying to make a filter for words inputted in to my website but i want to store the swear word and the replacement for that word in a mysql db i have developed the code below;

Did you know?Explore Trending and Topic pages for more stories like this.
<?php

include("config.php");


$str = 'how are you have you got any money';




$result = mysql_query("SELECT * FROM table")
or die(mysql_error());

while($row = mysql_fetch_array( $result )) {
$words = array($row['word'],);
$filter = array($row['translated_word'],);


}
echo str_replace($words, $german, $str);
?>

but it just dose not return the filters how i need it to it will only list it as it returns them like

wordwordwordwordword

but i need it to return them like

word,word,word,word,word

how would i do this? please help me =] thanks
No comments posted yet

Your Answer:

Login to answer
209 Like 24 Dislike
Previous forums Next forums
Other forums

mail() problem
Hi Guys,

I've set up a contact email form. It sends the information fine, but it sends it to

Help with usergroups? prolly really quick
So were coding our own forums for a game system we made an we have the users level setup but now I n

Secure FTP
Hi experts,
There is no SFTP action in MII workbench.
This means it needs developing custo

PHP File Upload Problem
Hi, I have written a very simple file upload script but it fails for reasons I can't explain. Hope

FPDF Help
I've been playing with the FPDF module. I was building a form and rolling right along and then sudde

ASP.NET 2.0 - Enter Key - Default Submit Button
Hi,One of the most annoying things in developing web pages is handling the "Enter key" for form subm

Random Number Generation And Probability
Hello, I am working on a function which has to insert data into a SQL table.

we have to suppl

Unique Visitor Tracking
Hello. Currently, I run a voting site where voters are tracked by their IP address and can only vote

Little problem with form insertion in MySQL, Please help!!!
Hi!,

I'm a little bit new with php and I have a little issue here. I created a webform to ins

how to validate date using javascript
I need to validate date in textbox using javascript..
The date is must be not greater than TODAY

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash