问题描述
http://localhost:3000/user?email=abc@gmail.com&pass=abc123
如何从URL隐藏这些密码和电子邮件。
实际上,我正在创建一个登录页面,用户将在其中输入电子邮件和密码。但输入凭据后,URL更改为http://localhost:3000/user?email=abc@gmail.com&pass=abc123
登录页面的代码附在下面。
<div class="col-xs-12 col-md-6">
<form action="/user" method="GET">
<div class="form-group">
<label for="Email">Email:</label>
<input type="email" class="form-control" name='email'>
</div>
<div class="form-group">
<label for="password">Password:</label>
<input type="password" class="form-control" name='pass'>
</div>
<div>
<button class="btn btn-success">
Login
</button>
</div>
</form>
</div>
解决方法
您应该使用POST方法。
<form action="/user" method="POST">