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;
<?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
parameter passing issue on function
Well I thought I had created a pretty slick web page, using ?page and $_GET to load pages which where really function calls.Here is a few lines that make up the menuCode:
PEAR in appliactiond development
When I was picking up PHP I went from procedural programming, fairly quickly into OOP, then after writing a bunch of custom libraries and applications I discovered CodeIgniter. I pretty much
How to login with SAPCPIC userid
I have changed the Password for SAPCPIC in Development Server for 000,001 and 100 client.
try catch error
I have been trying try catch but, I can't get it to work. The code opens a non existing file called "a"Code: private function fileOpenMethod($filePath,
Getting rid of quotes when printing data
Hi Guys, I use the filter_var FILTER_SANITIZE_STRING to filter the textarea input. The function escapes any quotes (which is good) but when I print the data into the html the data is printed with the
line breaks in between fetched file names
Hi,I have this code:Code: <?php if($dir = opendir('files')){ while (($file = readdir($dir) )!== false){ if ($file !='.' && $file !='..'){ echo
1,000 select boxes with 100 options?!
I have 1 drop down select box with 1,000 options.In some case, there will be 100+ of these select boxes, with absolutely identical options.Is there any way to avoid repeating 1,000 options for 100
Day of week
I am using PHP version 5.0.5I have a varaible ($DATE (date format yyyy-mm-dd)) that is being incremented to populate a table with each day of the month. I am then trying to get the day of week
PHP Surveys
I really would like some advice.If you have a client come to you asking for a survey to be done with 117 questions each has 4 radio button check boxes, and a overall percentage needs to be tallyed up.
mysql_real_escape_string making variable equal nothing
i post a form and i post the variable:Code: $var = $_POST[variable];then i echo $var its what i submitted the variable to be. then i add the mysql_real_escape_string() function to itspell it correctly