douhui8454 2012-06-20 01:12
浏览 95
已采纳

如何防止数据库向引号添加斜杠

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

  • 写回答

5条回答 默认 最新

  • doulifang5554 2012-06-21 09:27
    关注

    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.

    info from: http://support.godaddy.com/groups/web-hosting/forum/topic/how-to-turn-off-magic_quotes_gpc/
    Yes – the solution below worked for me:
    
    (1) First of all do not try to turn off the magic quotes in your .htaccess file, it won’t work on godaddy.
    (2) Second, if you’re running PHP5 on your account, rename your php.ini file to php5.ini, make sure it’s in your root folder.
    (3) Third, make sure all the lines in your php5.ini file end in a semi colon ;
    (4) Fourth, add this line to your php5.ini file:
    magic_quotes_gpc = Off;
    

    on the same page someone said it shouldn't be only magic_quotes_gpc only but other ones aswell like shown below:

    magic_quotes_gpc = Off;
    magic_quotes_runtime = Off;
    magic_quotes_sybase = Off;
    

    Hope this helped someone. Special thanks to @Stanislav Palatnik

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图