如何使用表单建立安全的页面传输?
我有 index.php
并且有一个登录表单:
<form method=post action="login.php" id="login">
<input type="text" size="16" maxlength="30" name="login" id="login_user" />
<input type="password" name="pass" id="login_pass"/>
<input name="msubmit" type="submit" value="Login" />
</form>
如何确保该表单通过安全线路进行处理?
我必须添加 https://
吗?
<form method=post action="https://test.com/login.php" id="login"
有什么想法吗?
谢谢。
I have index.php
and I have a login form:
<form method=post action="login.php" id="login">
<input type="text" size="16" maxlength="30" name="login" id="login_user" />
<input type="password" name="pass" id="login_pass"/>
<input name="msubmit" type="submit" value="Login" />
</form>
How can I make sure that the form gets processed through a secure line?
Do I have to add https://
?
<form method=post action="https://test.com/login.php" id="login"
Any ideas?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,最好的方法是指定
https
:即使
index.php
是通过安全通道提供的,显式指定https
也是一种很好的做法> 在 post 操作上,因为这是通过线路发送敏感数据的请求。但也建议仅通过https
提供index.php
。Yes, the best way is to specify
https
:Even if
index.php
was served through a secure channel, it is good practice to explicitly specifyhttps
on the post action because this is the request which sends sensitive data over the wire. But it is also recommended to haveindex.php
served throughhttps
only.使用https协议。还将所有参数视为
受污染
- 并让 PHP 脚本以负责任的方式处理它们。*即在使用数据库/命令行时解析(正则表达式)它们并在必要时转义它们*
Use https protocol. Also treat all the parameters as
tainted
- and get the PHP script to process them in a responsible fashion.*I.e. parse (regular expressions) them and escape them if necessary when using a database/command line *