Strict Standards: Only variables should be passed by reference in m_auth

前端 未结 4 1185
栀梦
栀梦 2020-12-22 14:16

I am working on a login system for a project using MVC programming and ran into this error. Here is the code, the problem line is #31

This login system is a tutoria

4条回答
  •  醉酒成梦
    2020-12-22 15:12

    The problem is that the 3rd parameter is the result of a function call:

    md5($pass . $this->salt)

    You need to save that value to a variable before passing it to bind_param so that it can be passed by reference.

    Example:

    $password = md5($pass . $this->salt);  
    $stmt->bind_param("ss", $user, $password);
    

    Also, don't use md5 to hash passwords.

提交回复
热议问题