如何隐藏隐藏字段中的值? [英] How to hide values in hidden fields?

查看:192
本文介绍了如何隐藏隐藏字段中的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的表单,其中有3个隐藏字段,通过这些字段我将值传递给另一个页面.

I have a simple form in which I have 3 hidden fields, through which I am passing values to another page.

但是我不希望任何人通过查看页面源代码或Fire Bug看到它.我正在使用PHP.

But I don't want anyone to see it through view page source or Fire Bug. I am working with PHP.

<form action=" " method="post" name="push">
    <input type="hidden" name="publisherid" value="createcoolapps"/>
    <input type="hidden" name="username"value="buzzmo"/>
    <input type="hidden" name="pass" value="Javea0615"/>
    <select name="appid">
        <option value="QRScanner">app1</option>
        <option value="app2">app2</option>
        <option value="app3">app3 </option>
        <option value="app4">app4</option>
    </select > 
    <input type="hidden" name="topics" value=" "/>
    Notification Message:<br />
    <textarea style="width:10; height:10;" name="pushmessage"></textarea><br/>
    <input type="submit" value="Push"/>
</form>

推荐答案

您不能.如果您想对访问者保密,请不要将其提供给访问者的浏览器.

You can't. If you want to keep something secret from the visitor, don't give it to the visitor's browser.

将数据存储在服务器上,然后将与该数据相关的令牌发送到浏览器.当浏览器将其提交回时,使用令牌查找数据.

Store the data on the server and send a token related to that data to the browser instead. Look the data up using the token when the browser submits it back.

您可以为此使用会话(尽管要注意比赛条件).

You could use sessions for this (although beware of race conditions).

这篇关于如何隐藏隐藏字段中的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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