数据将如何编码和发送?

时间:2013-01-11 08:39:34

标签: php html forms uri

<form action="http://somedomain.com/login/select_from_users.php" method="GET">
User name: <input type="text" name="user_name" size="10">
Password: <input type=text name="password" size="8">
<input type="submit" value="Query">
<input type="reset" value="Clear">

如果已使用“John Smith”“one&two&”完成此操作:

3 个答案:

答案 0 :(得分:1)

与在浏览器地址栏中输入以下内容相同:

http://somedomain.com/login/select_from_users.php?name=John%20Smith&password=one%26two%26

space变为%20&变为%26

答案 1 :(得分:0)

我更喜欢将方法设置为&#34;发布&#34;。如果我们使用get方法,我们从用户获得的输入详细信息将显示在包含密码的URL上,

答案 2 :(得分:0)

我不知道为什么你需要对用户自己输入的数据进行编码,除了密码部分之外,没有人应该看到,这就是你应该使用post方法的原因,

如果您需要将数据安全地传递到服务器(来自用户),那么您需要的是SSL

如果您只使用 METHOD =“POST”,用户将无法在网址栏中看到任何数据,如果这就是您的意思