【问题标题】:How will the data have been encoded and sent?数据将如何编码和发送?
【发布时间】:2013-01-11 08:39:34
【问题描述】:
<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&amp;two&amp;” 完成:

【问题讨论】:

  • 如果您不想在Query String 中看到您的值,请使用POST 方法
  • 不清楚你在这里问什么。您是在问编码字符串的外观或浏览器如何获取编码字符串?

标签: php html forms uri


【解决方案1】:

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

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

space 变为 %20&amp; 变为 %26

【讨论】:

    【解决方案2】:

    我更喜欢将方法设置为“post”。如果我们使用 get 方法,我们从用户那里获取的输入详细信息将在 URL 上可见,包括密码,

    【讨论】:

      【解决方案3】:

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

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

      如果您只是使用 METHOD="POST",如果您的意思是这样,用户将不会在 URL 栏中看到任何数据

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-09-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-11-30
        相关资源
        最近更新 更多