i know this sounds really common and so trivial but , am having a challenge here. I have a web site with Zend/Doctrine and i use ckeditor for the backend management. after uploading the site i've realized that during edit testing the look and feel of the site is messed up.
with the help of firebug, i've seen that there are slashes all over the html. after inline edition, the look and feel came back to normal. There are so many files , i can't think of doing other decoding before outputting data from mysql.
What options do i have to solve this problem. the site is up already and i feel a bit unconfortable about this. Can anyone give a hint? thanks
add this to your php page which has insert/update query :)
It seems like you're data is getting double escaped before being inserted into your database. Are you using
mysql_real_escape_string
oraddslashes
before inserting data into the database? If so, maybe you want to use stripslashes before you insert your data like so:Or else you could theoretically call stripslashes after you take the data out of the database:
The second approach is less desirable, though. It would be better to have the data properly stored in the database.
I thank every one for the help. Really the accepted solution should be the one from @Stanislav Palatnik . just that it didn't work with my .htaccess. the hosting server was nice enough to put a php.ini in my public_html allowing me to change it. So +1 to @Stanislav Palatnik because he pointed out the issue. i also found interesting information i thought i would share in case someone found himself in my situation.
on the same page someone said it shouldn't be only magic_quotes_gpc only but other ones aswell like shown below:
Hope this helped someone. Special thanks to @Stanislav Palatnik
In case this is a magic quotes problem and as i recall you only having access to your application.ini, you might add the following and give it a try
This still requires your user / usergroup to be allowed to change default php settings ;)
It might be
magic_quotes_gpc
. Can you verify that it's turned off?Here is a way to turn it off: http://php.net/manual/en/security.magicquotes.disabling.php
Also, are you using prepared statements? PHP PDO/MySQLI will escape automatically for you. Depends on the type of queries you're using.