i want my password to be md5 using the codes posted, after execution i checked db content and its not in md5 format |
[eluser]Alpha[/eluser]
i want my password to be md5 using the codes posted below, after execution i checked db content and its not in md5 format, is there something i missed? tnx $this->form_validation->set_rules('password', 'Password', 'trim|required|matches[passconf]|md5'); $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email'); $this->db->query("INSERT INTO users (email, password) VALUES ('".$this->input->post('email')."', '".$this->input->post('password')."')");
[eluser]jzmwebdevelopement[/eluser]
[quote author="anthar" date="1311511809"]i want my password to be md5 using the codes posted below, after execution i checked db content and its not in md5 format, is there something i missed? tnx $this->form_validation->set_rules('password', 'Password', 'trim|required|matches[passconf]|md5'); $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email'); $this->db->query("INSERT INTO users (email, password) VALUES ('".$this->input->post('email')."', '".$this->input->post('password')."')");[/quote] Yes: Have a read here: http://ellislab.com/codeigniter/user-gui...elper.html
[eluser]Aken[/eluser]
It's also not recommended to use md5() to encrypt passwords: http://www.php.net/manual/en/faq.passwor...s.fasthash
[eluser]InsiteFX[/eluser]
You need to hash and encrypt the password before you send it to the database! When checking the entered password you need to do the same when checking it from the database. Code: // -------------------------------------------------------------------- InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |