Passwords suddenly not working
| From: | Dave M G | Date: | Wed, 29 Nov 2006 09:00:10 +0000 |
| Subject: | Passwords suddenly not working | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-245268@lists.php.net to get a copy of this message | ||
PHP List,
I have a few scripts that have been around for a while. In one, is a simple login function:
$query = "SELECT * FROM forum_members WHERE memberName = '" . $username . "' AND passwd = MD5('" . $password . "')";
$result = mysql_query($query);
This was working fine, but recently I haven't been able to log in. I think the only thing that has changed is that on my hosting service, they recently upgraded to PHP 5.1.6. (MySQL is 4.1.21, but I think it's been that for quite a while)
Is there any potential for PHP 5.1.6 to handle things different when it comes to MySQL queries, post data, or anything? I thought it might be that I still had $HTTP_POST_VARS for some of my variables, but I changed them all to $_POST, and it still doesn't work.
I don't get any errors or anything. My own code is not very sophisticated for error reporting. But I'm not getting any PHP syntax errors of any kind. If I run the SQL code by itself at an SQL command prompt, I get results back, so I don't think the SQL is failing.
Are there any gotchas in the upgrade that I might be missing? I can't think of anything else that could be a culprit (though of course I'm open to suggestions).
Any advice would be much appreciated.
--
Dave M G
Ubuntu 6.06 LTS
Kernel 2.6.17.7
Pentium D Dual Core Processor
PHP 5, MySQL 5, Apache 2