0

我有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"

有任何想法吗?

谢谢。

4

2 回答 2

1

是的,最好的方法是指定https

<form method="post" action="https://domain.com/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>

即使index.php通过安全通道提供服务,最好https在发布操作上明确指定,因为这是通过网络发送敏感数据的请求。但也建议只index.php送达https

于 2011-09-21T22:00:18.287 回答
0

使用 https 协议。还将所有参数视为tainted- 并让 PHP 脚本以负责任的方式处理它们。

*即在使用数据库/命令行时解析(正则表达式)它们并在必要时对其进行转义*

于 2011-09-21T22:02:35.613 回答