dongsuo0517 2016-12-06 19:28
浏览 74

验证MD5哈希密码

I'm trying to implement MD5 into the login form of my website. I have been able to use MD5 on the registration form to hash the password, its just being able to convert the login password to that stored in the database.

The code used on the register form:

    $password = md5($password);

The code that doesn't work on my login form:

$sql = "SELECT username FROM custlogin WHERE username = '.$_POST[username].' AND password=md5('$_POST[password]')";

This isn't going to be a live website, it's part of an assignment.

  • 写回答

1条回答 默认 最新

  • dongyi5070 2016-12-06 20:10
    关注

    Hello Jack :D you can try this ! for me it works :D

    $username = $_POST['username'];
    $password = md5($password);
    
    $sql = "SELECT username FROM custlogin WHERE username = '$username' AND password='$password';";
    
    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改