脚本注入 - 表单验证(jQuery) [英] Script injection - form validation (jquery)

查看:97
本文介绍了脚本注入 - 表单验证(jQuery)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这是验证我的表单的最佳方法/方法,如果我不想用户通过我的表单向数据库发送任何脚本?

解决方案

忘掉jQuery。您不能使用客户端上运行的任何东西来保证安全 - 客户端始终可以覆盖它。



您需要处理服务器上的数据。请参阅如何防止PHP中的SQL注入?以保护你的数据库和什么是避免PHP网站中的xss攻击的最佳实践,以保护您的网页。


I use several forms on my site to send data to MySQL.

Which is the best way / method to validate my form, if I don't want to users send any script to the database through my forms?

解决方案

Forget about jQuery. You can't use anything running on the client to make things safe — the client can always override it.

You need to deal with the data on the server. See How can I prevent SQL injection in PHP? to protect your database and What are the best practices for avoiding xss attacks in a PHP site to protect your pages.

这篇关于脚本注入 - 表单验证(jQuery)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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