防止SQL注入的最佳方法? [英] Best way to prevent SQL Injection?

查看:468
本文介绍了防止SQL注入的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好......我只是想知道什么是阻止SQL注入的最佳方法?有人建议使用addslashes和一些建议使用mysql_real_escape_string()现在我只想知道什么是最好的函数?

解决方案

使用带参数的存储过程


XKCD [ ^ ]。


在安全方面你不能仅仅在1个机制上进行中继你应该有更多,如果入侵者打破你有一个第二个准备好。



以下链接将帮助您开发一些针对SQL注入的良好安全性。



使用PHP防止SQL注入 [ ^ ]



SQL注入攻击以及如何防止它们的一些提示 [ ^ ]



在PHP中停止SQL注入的最佳方法 [< a href =http://stackoverflow.com/questions/60174/best-way-to-stop-sql-injection-in-phptarget =_ blanktitle =New Window> ^ ]

Hi guys... i was just wondering what will be the best approach to prevent SQL Injection? Some suggested to use addslashes and some suggested to use mysql_real_escape_string() now i just want to know what is the best function to use?

解决方案

use stored procedures with parameters


XKCD[^].


In security u can not relay on only 1 mechanism u should have more so if intruder break one u have second ready.

The following link will help u to develop some good security against SQL Injection.

Preventing SQL Injection with PHP[^]

SQL Injection Attacks and Some Tips on How to Prevent Them[^]

Best way to stop SQL Injection in PHP[^]


这篇关于防止SQL注入的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆