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

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -