duanchifo2866 2016-08-23 20:54 采纳率: 100%
浏览 138
已采纳

从HTML安全地获取密码

I want to get a password from an input form in a safe manner. Originally I was using $_POST[] but I would like a safer method that is reasonably simple and effective.

GetElementById does not seem like a good solution for this but if you think otherwise can you please let me know as I'd like to use it elsewhere if it is.

HTML

<div class="form-group" >
<input type="password" name="password" class="form-control input-lg" placeholder="Password" required>
</div>
  • 写回答

1条回答 默认 最新

  • dqn48247 2016-08-23 20:59
    关注

    There is nothing wrong with getting a password from $_POST. That is how you access HTTP POST data in PHP. HTTP POST is how login forms work on pretty much every website out there, including your bank's.

    But you must do it over an encrypted connection (that is, one that uses TLS). That is the only way to be secure.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥15 用visual studi code完成html页面