CodeIgniter框架JustWallet 2.0.4登录注册功能故障排查请求
Alright, let’s break down the issues you’re facing with your JustWallet 2.0.4 site—since it’s built on CodeIgniter, we can narrow down the root causes based on the error messages and typical framework behavior.
First, a quick recap of your problems:
- Valid database credentials trigger "Invalid username or password"
- Logging into an existing account throws "Unable to access an error message corresponding to your field name Password.(_check_login)"
- New registrations fail with "Your account could not be created at this time. Please try again."
1. Password Hashing Mismatch (Top Suspect for Login Errors)
Older CodeIgniter versions (like the one powering JustWallet 2.0.4) rely on either the framework’s built-in password hashing tools or custom logic. Here’s what to check:
- Peek at the
_check_loginmethod: This is referenced in your error, so look in the user controller (probablyapplication/controllers/User.php). Make sure it’s usingpassword_verify()to compare the submitted password against the stored hash in your database.- If your database has plain-text passwords but the code tries to verify a hash, or vice versa, you’ll get the "invalid credentials" error every time.
- Check registration hashing: When creating a new account, confirm the password is being hashed before saving to the database. If it’s stored as plain text but login uses
password_verify(), verification will fail.
2. Missing Validation Language File Entry
The error about "unable to access an error message for Password.(_check_login)" is a classic CodeIgniter validation quirk:
- CodeIgniter pulls validation error messages from
application/language/english/form_validation_lang.php(or your language folder). Open this file and look for an entry for_check_login. If it’s missing, add it:
This fixes the missing error message that’s popping up during login.$lang['_check_login'] = 'Invalid username or password.';
3. Database Connection/Structure Issues
Both login and registration failures can trace back to database problems:
- Verify database credentials: Double-check
application/config/database.phpfor typos in hostname, username, password, or database name. Even a small mistake here can block read/write operations. - Inspect user table columns: From your database screenshot, ensure the
passwordcolumn is long enough (bcrypt hashes need at least 60 characters—if it’s shorter, the hash gets truncated and can’t be verified). Also confirm required columns likeusernameoremailexist and have the correct data types. - Enable query logging: Turn on database debug mode in
application/config/database.phpby setting$db['default']['db_debug'] = TRUE;. Then checkapplication/logs/to see if login/registration queries are running correctly (look for syntax errors or missing values).
4. Login View (login.php) Form Problems
Since you shared the login.php view path, check these details:
- Ensure form input
nameattributes match what the controller expects. For example, if the controller looks forusernamebut your input hasuser_name, the credentials won’t be passed correctly. - Confirm the form uses the POST method (never use GET for sensitive data like passwords). If it’s using GET, the controller might not receive the password at all.
- Make sure there’s no extra filtering (like stripping special characters) on the password input that would alter the value before verification.
5. Registration Controller Logic Flaws
For the failed registration error:
- Check the registration controller’s insert logic: Look for
$this->db->insert('users', $data);and verify that$dataincludes all required fields (no missing values or mismatched data types). - Check for database constraints: If you’re trying to register a duplicate username/email, the database will reject the insert. The controller might catch this and display the generic "could not be created" message instead of a specific error.
- Enable full error reporting: Add
error_reporting(E_ALL);to your rootindex.phpfile—this will reveal hidden database or PHP errors that might be causing the registration failure.
内容的提问来源于stack exchange,提问作者ReadytoMaster

