客户端验证Javascript或服务器端验证PHP [英] Client-side validation Javascript or Server Side validation PHP

查看:129
本文介绍了客户端验证Javascript或服务器端验证PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单,提交在数据库中输入的数据。是否建议同时执行客户端和服务器端验证?

I have a form which submits data which is entered in the database. Is is recommended to perform both client side and server side validation ?

推荐答案

这里的很多答案都涉及信任,但这并不完全是OP要求的是什么。

A lot of answers here deal with trust but that's not exactly what the OP is asking.


是否[建议]执行
客户端和服务器端验证

Is [it] recommended to perform both client side and server side validation ?

,在现代网络应用程序中,用户期望快速响应,如果您可以做一些简单的数据质量检查前面,做它们。这样做只会让用户的生活更美好。出于同样的原因,出于安全原因,您必须进行服务器端验证。我遵守以下规则...

Yes, in modern web applications users expect fast responses and if you can do some simple data quality checks up front, do them. Doing so can only make the user's life better. On the same token you must do server side validation for security reasons. I live by the following rule...

客户端是否检查可用性并进行服务器端检查以确保数据完整性和安全性。

这篇关于客户端验证Javascript或服务器端验证PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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