A couple people have mentioned this, so I thought I should post a blog entry on it so I can point people here is more people have trouble...
OOP Version
Specifically, when PHP's error reporting is set to "Strict", you'll get this error when following along with my code:
I'm not sure if this error is something new, but this error wasn't something that I ran into when creating or testing the series. However, here are a couple ways to fix it:
Non-OOP Version
Specifically, when PHP's error reporting is set to "Strict", you'll get this error when following along with my code:
This issue also occurs on the non-OOP version of the PHP login course, and here's the fix. You can change your PHP error settings as I indicated above, or change this line in login.php:
to
OOP Version
Specifically, when PHP's error reporting is set to "Strict", you'll get this error when following along with my code:
Strict standards: Only variables should be passed by reference in [path to the source code]\models\m_auth.php on line 31
I'm not sure if this error is something new, but this error wasn't something that I ran into when creating or testing the series. However, here are a couple ways to fix it:
- Update your PHP.ini file to change the error reporting settings or turn off strict error reporting using PHP code: http://php.net/manua...r-reporting.php
- Alternately, you can update the code itself to fix this, by changing this line in the m_auth.php file:
$stmt->bind_param("ss", $user, md5($pass . $this->salt));
to
$pw = md5($pass . $this->salt); $stmt->bind_param("ss", $user, $pw);
Non-OOP Version
Specifically, when PHP's error reporting is set to "Strict", you'll get this error when following along with my code:
Strict standards: Only variables should be passed by reference in [path to source code]\login.php on line 46
This issue also occurs on the non-OOP version of the PHP login course, and here's the fix. You can change your PHP error settings as I indicated above, or change this line in login.php:
$stmt->bind_param("ss", $input['user'], md5($input['pass'] . $config['salt']));to
$pw = md5($input['pass'] . $config['salt']);
$stmt->bind_param("ss", $input['user'], $pw);
Help
Leave Comment








