Call to Undefined Function Password_Hash()

Call to undefined Function and array keys in PHP even though it has been clearly been defined?

When you refer to another method inside the same class, you need to prefix it with $this. So this code:

$userid = create_userid();

Should be:

$userid = $this->create_userid();

Also note, your code is vulnerable to SQL injection attacks. Instead of building queries with string concatenation, always use prepared statements with bound parameters. See this page and this post for some good examples.

And never store plain text passwords. Instead use password_hash() and password_verify().

PHP 7.0.5 password_hash() error

I am almost certain your server is not running what you think it is. mod_fcgid is an Apache module and .htaccess is also Apache specific so you are probably not running Nginx. The password hashing functions were added in PHP 5.5.0. I'm going to say that you are actually running an Apache server with PHP < 5.5.0. You need to use the compatibility library to get the password hashing functions.



Related Topics



Leave a reply



Submit