![]() |
My login page is not working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: My login page is not working (/showthread.php?tid=79143) |
My login page is not working - velismo - 04-28-2021 Hi, there! I'm trying to create a login page and a registration page. The registration works perfectly, or I believe so, but the login not. When I introduce the username and the password, it brings me an error login message "login invalid" and I don't know why. I saw you here my code: CONTROLLER (Pages.php) PHP Code: public function login(){ MODEL(User_model.php) PHP Code: public function login($username, $password){ VIEW(login.php) PHP Code: <?php echo form_open('users/login'); ?> I'm seriously mad right now because I cannot see the problem and it's starting to be a little bit frustrating. Please any guide will be more than welcome. Thank you so much and have a great day. RE: My login page is not working - InsiteFX - 04-28-2021 For one you should not be using MD5 it is a security waiting to happen. Use the PHP.net - password_hash and password_verify RE: My login page is not working - iRedds - 04-28-2021 The question level is why two plus two does not equal five. This is a forum thread for CodeIgniter4. Find the problem yourself. RE: My login page is not working - velismo - 04-29-2021 (04-28-2021, 10:34 PM)iRedds Wrote: The question level is why two plus two does not equal five. Why you waste your time giving that kind of answer?. I've found the problem. What I'm trying to get now is the solution. Anyway, have a good day. You will need it. RE: My login page is not working - demyr - 04-29-2021 Check your model, part: PHP Code: if($result->num_rows() == 1){ to try it, just get a row as return without if($result->num_rows() etc). An example PHP Code: public function check_login($username, $password){ On your controller, just query: PHP Code: if($check_login) { Btw, MD5 is not so secure. Take InsiteFX's suggestion into consideration |