防止显示一行源代码 [英] Prevent a line of source code from showing

查看:93
本文介绍了防止显示一行源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何隐藏这个html行,不会出现在inspect元素或视图源中的用户。

 < input type =hiddenname =kdavalue =<?php echo $ code;?> ;> 

我该如何做?

解决方案

您无法这样做 - 您发送给浏览器的所有内容最终都会以某种方式读取和存储。

您可以做什么但是,使用会话来存储这些信息。然后,只有会话标识符会发送到浏览器(并返回到服务器),而您的敏感信息可以留在服务器上。


How to hide this html line, that will not appear for the user in inspect element or view source.

<input type="hidden" name="kda" value="<?php echo $code;?>">

how can I do this?

解决方案

You can't do that - everything you send to the browser can eventually be read and stored somehow.

What you can do instead, however, is using a session to store this information. Then, only a session identifier will be sent to the browser (and back to the server) while your sensitive information can stay on the server.

这篇关于防止显示一行源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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