sql - Trying to remove special characters in PHP -


i have form has text inputs. when add them db '\' character before each special character {', ", etc}. want remove '\' before entering text db far have been unable to. tried doing in php before execute query:

$title_str = str_replace('\'','',$_post['main_title']); 

but did not work.

thanks,

sounds magic quotes still turned on. should disable them. safe thing do.

http://www.php.net/manual/en/security.magicquotes.disabling.php

also, sure use prepared queries (with pdo or similar) when inserting data in database avoid sql injection problems.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -