Re: Trying to understand sessions and using them to authenticate...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Aug 28, 2007, at 10:03 AM, Daniel Brown wrote:

On 8/28/07, Jason Pruim <japruim@xxxxxxxxxx> wrote:
[snip]
        $sql = "SELECT * FROM users WHERE user='".$user."' AND
pass='".$pass."' LIMIT 0,1;";
        $result = mysql_query($sql) or die("Wrong data supplied or
database error");
        while($row = mysql_fetch_array($result)) {

    Sounds to me like you're not getting through the while() clause,
meaning that there's no matching rows in the database.

    $sql = "SELECT * FROM login WHERE loginid='".$user."' AND
email='".$pass."' LIMIT 0,1;";

    Is the password they supply in the `email` column of the database?

Yes it is... For now... I am just using test/test and I had a field named password in the database but thought that was messing it up, so I dropped that field and currently I am just using the e-mail field as a password.

Once it works I'll change the field to a more appropriate selection with MD5 hashing, and maybe even a little salt in the hash. (Gotta add the flavor!)


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
japruim@xxxxxxxxxx

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux