我有一个包含两个输入字段的登录表单:用户名和密码。
<form method="get" action="../Main/Index">
<p>
<input type="text" name="username" value="" placeholder="username" maxlength="30"></p>
<p>
<input type="password" name="password" value="" placeholder="password" maxlength="25"></p>
<p class="submit">
<input type="submit" name="commit" value="Enter">
</p>
</form>
一旦用户提交表单,他的用户名和密码就会显示在浏览器的 URL 文本框中,如下所示:
http://localhost:53997/Main/Index?username=zm&password=123456789&commit=Enter
我不想显示他的用户名和密码。
我该怎么做?
最佳答案
问题是你在使用 form method = "get"
而你应该使用 form method = "post"
。
这解释了:
http://msdn.microsoft.com/en-us/library/ee784233(v=cs.20).aspx
关于html - 从 URL 隐藏表单输入字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24613724/