[eluser]DiogoAbdalla[/eluser]
Hello all.
I am a freelancer PHP programmer and Ive recently taken a project to add some new sections to a website made using CodeIgniter.
After copying the database and code and files to my machine (WAMP, using PHP 5.2), I changed a few path settings and got the website working perfectly. So far, so good.
But when I try to log on the admin area of said website, my password wanst matching. This is the same code and the same database, and that password works when in the production server.
So I went to the code to find out what could be wrong. I found this:
Code:
if($pwd == $this->encrypt->decode($row->user_pwd))
Where $row is the user loaded from the database, and $pwd is the password form the login form. OK, makes sense: the password is stored encrypted, then its decoded to match the password typed by the user. But why that same password matches online, but not on my machine?
I checked the database first. Found the exact same hash on both databases (online and local).
So I went to see what "$this->encrypt->decode($row->user_pwd))" is giving me. And I found that, on my machine, it spits something like this:
Code:
OG���V�u�1g���[��WM�a�C��O�
Instead of the password it was supposed to be.
So, why is this happening? My local server is working fine, never had any problems with it. What CI uses to encrypt and decrypt those passwords that is producing different results on both machines?
They are different machines, of course: the production server is linux (dont know which one), while my local machine is Windows 7. But both are using PHP 5.2 and MySQL 5.1.
Anybody could help figure why this happens? And how can I fix it?
Any help will be much appreciated.