stripSlashes function
| From: | Lisi | Date: | Mon, 20 May 2002 09:33:20 +0000 |
| Subject: | stripSlashes function | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-19266@lists.php.net to get a copy of this message | ||
I have a form that allows a person to enter an announcement into a database using a form. The form and the query work fine.
$query = "INSERT INTO maztov (fullname1, fullname2, city1, city2, email1, email2, post_fullname, mazal_text, post_city, post_email, other_emails, entered) VALUES ('$fullname1','$fullname2','$city1','$city2','$email1','$email2','$post_fullname','$mazal_text','$post_city','$post_email','$other_emails', NOW())";
$result = mysql_query($query);
Then I realized MagicQuotes was adding slashes to my query, so I added this line:
$query = stripSlashes($query);
before I executed the result. Now the result is no longer executing, i.e. the entry is not being added into the database.
When I echo the query before and after stripslashes has been applied, it is echoing exactly what I think it should. When I comment out the line with stripslashes, it works again but with adding quotes.
What am I doing wrong?
Thanks,
-Lisi