Results 1 to 2 of 2
Thread: Getting slashes from db
Jun 15, 2001, 22:01 #1
Getting slashes from db
I put some text into my db, using a php script, and then I pulled it back out, (CMS, duh!) but I has some funky slashes, and it isn't every where either, only preceding a ' in the word won't. I think I am just forgetting a function to get rid of thses, but why did I get 3? Check it out here: http://www.juniorsailing.com/tips/in...?zone=optimist it is the 2nd tip in the list.
Jun 15, 2001, 22:29 #2
- Join Date
- Aug 2000
- San Diego, CA
- 0 Post(s)
- 0 Thread(s)
Most likely because you have magic_quotes_gpc set to On in your php.ini file, so it automatically adds the slashes so it will get into the database successfully since a single quote would normally cause an error. To get rid of them before you display the variable run stripslashes() on it. Check out www.php.net/stripslashes for more information.
$str = stripslashes($str);
Please don't PM me with questions.
Use the forums, that is what they are here for.