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
Last character removed
I have created a string from an array. I have inserted commas from my form values. I am trying to remove the last comma from the string and can't seem to remove it. I have tried chop, rtrim, substr,
Multidimensional array problems in $_POST
I'm having trouble with a three-dimensional $_POST array. It starts as a two-dimensional array on this side:Code: <html> <head>
Mysql query, two times?
Hello to all,I'm new to php coding and i like it alot. I need help with some noob stuff.1. Having problem with mysql query after submiting HTML form. It's allways execuding two times, that way i have
foreach iterator
Hi GuysDoes the foreach loop have an inbuilt iterator ?
Buggy registration system
Hey, I just started scripting in PHP, and I ran into a few problems.Code: <?phpinclude('config.php');if
Display the user's weight lost in the past week
Hello everyone,I am working on a weight loss app for my site, and I want to display the user's weight lost in the past week, I have the current weight and the total weight lost today working great,
A Few Questions
Hi, I want to ask a few questions that I can't seem to find..1) I'm creating a "shortcut" system on my website, where users can add shortcuts from pages by clicking the link and it will
Session
I am having a little trouble with a session. Not sure if it is my browser or what. I know I do not have any trouble logging into forums such at these, so not sure why this is not working.first the
Solution to the FindControl problem
I have seen may posts about having problems with the FindControl method. Most seem to come about because the control being searched for is nested within a container other than the webform.I came
Add a sign-up feature to a flat file login script
I'm working on a flat file login script and I would like to add a sign-up feature to it with a email confirmation process.Here is my code :Line number On/Off | Expand/Contract <?php//sessions