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
Fatal Error: Uncaught Argumentcounterror: Too Few Arguments to Function
How to Fetch Data in PHP with MySQLi
Imagick Not Loading Images, with 'Nodecodedelegateforthisimageformat' Error Message
Using Seo User Friendly in PHP
Unserialize PHP Data in Python
Google+ Login via JavaScript and PHP
How to Extract Http Links from a Paragraph and Store Them in a Array on PHP
Do PHP Opcode Cache Work with _Autoload
Mysqli Query Doesn't Work Twice
PHP Loop Through Associative Arrays
How to Prevent Self Closing Tag in PHP Simplexml
Add Custom User Email to Cc for Specific Woocommerce Email Notification