Jump to content

Zebadee

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Zebadee's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi guys, I have done alot of login scripts in the past, but now i have decided to try a more secure way, using md5 encryption. I have encrypted the password correctly in the database and now my function keeps returning false. My login function is part of a class i made. $this->tablename, $this->accountname, $this->usersession and $this->dbconnection are perfectly fine as they have been working when i tried it without encryption. Why isn't this working? [code]   function Login($pass)      {       $password = md5($pass);             $query = "SELECT * FROM `$this->tablename` WHERE `Username` = '$this->accountname' AND `Password` = '$password' ";            $result = mysql_query($query, $this->dbconnection);                                                                                   if (mysql_num_rows($result) > 0)                      {                                                                $this->usersession = $this->accountname;                      session_register($this->usersession);                              $query = "UPDATE `$this->tablename` SET `Online` = '1' WHERE `Username` = '$this->accountname' LIMIT 1";                           mysql_query($query, $this->dbconnection);                                                                                return true;                      }                          else                          {                                                      return false;                                                   }                        } [/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.