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

Php mysql - select?
Hi i have this code:
Code: $iteminfo = mysql_query("SELECT desc FROM wc_items WHERE itemid =

Problem in back link
I have page where i have given javascript back link but when i click on it browser give a message

dinamic "textboxes"?
Ey all, my first post here, i hope its not a hard one

I display mysql results in a table

How would I protect......
I have a from, actually, a good amount of forms. How can I make it so you can't type the characters:

php calculate
this code echoes correctly the sum but the inserted result is 0??
Code: <?php
$TotalNum

An odd assignment statement. Can someone explain this assignment to me?
What purpose is served by the bit of code between the two equal signs in the $installurl set? Is th

Getting rid of quotes when printing data
Hi Guys, I use the filter_var FILTER_SANITIZE_STRING to filter the textarea input. The function esca

Re-Order by ID Number
I have a cms set up for inputting an image, thumb, title, pdf, and eps. When input the database ass

want to add a break after a certain amount of characters
i was wondering how to add a break in a blog post after a certain amount of characters... any idea o

Help: calling function
Hi,
Is it possible to call a php function on page close?
If yes, could you explain how and whe

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