【发布时间】:2014-05-22 15:29:47
【问题描述】:
我在一个项目中发现了这个表单,它在 Chrome 中运行良好,但在 Internet Explorer 中却不行。 IE8 确实将表单作为 POST 提交,但不发送隐藏输入:
<form name="logout_frm" id="logout" action="index.php" method="post">
<label>Logout</label>
<input type="hidden" name="logout" value="1" />
<input type="submit" name="logoutBtn" value="logout" />
</form>
这是我从fiddle2 获得的原始数据,WebForms Tab 也是空的:
POST https://example.com/index.php HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, */*
Referer: https://hostname.net/index.php
Accept-Language: de-DE
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: hostname.net
Content-Length: 0
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: GUEST_LANGUAGE_ID=en_US; COOKIE_SUPPORT=true; ntlm=1; PHPSESSID=28b0fbgol5bnq56qqst423p80ota470sqclbnpc4p5egqqdbt4tw
Authorization: NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAAAbEdAAAAAA==
更新
如果我清除缓存并重新加载页面,它会运行一次,但只能运行一次。也许这与 NTLM 登录 Authorization: NTLM 有关。
【问题讨论】:
-
无论如何,依赖隐藏字段通常不是一个好主意,因为它们的值可以通过 js 或 devtools 轻松更改。
-
@Mooseman 你在说什么?
-
一般@Mooseman 是对的,但在这种情况下,隐藏字段的内容无关紧要,通过操作不会造成任何伤害。
标签: html forms post internet-explorer-8