更改隐藏字段的值,通过检查元件改变在服务器端实际值 [英] Changing value of hidden field through inspect element changes actual value in server side

查看:114
本文介绍了更改隐藏字段的值,通过检查元件改变在服务器端实际值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题。我存储的隐藏字段一些DATAS。当我改变隐藏字段的值,通过检查的元素,它在服务器端也得到改变。

I have a strange problem. I am storing some datas in hidden field. When I changed value of hidden field through inspect element, it get changed in server side also.

与实际值的隐藏字段

值改为通过检查元素

在结果服务器端

我希望用户不改变潜在价值或由用户更改了该值应该不会影响实际值。
任何人都可以请帮我解决这个问题?

I want the user not to change the hidden value or the value changed by the user should not affect actual value. Can anyone please help me to solve this problem?

推荐答案

这是不可能阻止别人在控制台修改DOM。

It is not possible to stop someone amending the DOM in the console.

您需要验证发送到服务器的值都在服务器端有效的做对他们的任何工作之前。

You need to verify that the values sent to your server are valid on the server-side before doing any work on them.

如果你有一些数据,你不希望任何人修改,你需要有加密,或不显示它在所有客户端上的一些方法。

If you have some data which you do not want anyone to amend you would need to have some method of encrypting it, or not displaying it at all on the client side.

这篇关于更改隐藏字段的值,通过检查元件改变在服务器端实际值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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