A login script that works great in regular Codeigniter will not work in HMVC - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: A login script that works great in regular Codeigniter will not work in HMVC (/showthread.php?tid=62254) |
A login script that works great in regular Codeigniter will not work in HMVC - Codin2015 - 06-24-2015 I am building a shopping cart in hmvc but every time I build my login script in regular codeigniter it works great but every time I switch it over to HMVC something goes wrong and I keep getting a 404 page not fiind when I click the login in button. Here is the controllers I am using and and models and views for login. First my Login view. Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Then my home contoller Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Then my verify controller Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Then my model Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); and my views first login view Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> I do not know what to think when I run this script on regular codeigniter it works fine but when I run it on HMVC I get an 404 errror saying verify is not found. all help greatly appreciated. I do not know what possibly could change by going from regular codeigniter to HMVC. all help greatly appreciated. RE: A login script that works great in regular Codeigniter will not work in HMVC - Codin2015 - 06-30-2015 I found the answer to my question it is all in the routes you have to name the different controllers as such $route['verify'] = 'modulename/verify/index'; this solved my problem. I do not know if you have to do this for each module you add or not. RE: A login script that works great in regular Codeigniter will not work in HMVC - InsiteFX - 06-30-2015 (06-30-2015, 02:05 PM)Codin2015 Wrote: I found the answer to my question it is all in the routes you have to name the different controllers as such $route['verify'] = 'modulename/verify/index'; this solved my problem. I do not know if you have to do this for each module you add or not. Did you add this to your ./application/config/config.php ? PHP Code: /* RE: A login script that works great in regular Codeigniter will not work in HMVC - Codin2015 - 07-13-2015 (06-30-2015, 09:24 PM)InsiteFX Wrote:(06-30-2015, 02:05 PM)Codin2015 Wrote: I found the answer to my question it is all in the routes you have to name the different controllers as such $route['verify'] = 'modulename/verify/index'; this solved my problem. I do not know if you have to do this for each module you add or not. RE: A login script that works great in regular Codeigniter will not work in HMVC - Codin2015 - 07-13-2015 No I did not but I will try that next thank you. |