CodeIgniter Forums
Always defaults to index function - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Always defaults to index function (/showthread.php?tid=46994)



Always defaults to index function - El Forum - 11-22-2011

[eluser]alexbet[/eluser]
Hi,

I am having a very weird problem all of a sudden. I have some controllers in a folder like this:

/controllers/admin/

And inside this folder I have a few controllers and all are working file but one. The controller name is "browse_deals". I am not sure if the name has anything to do with it, but I have two functions in this controller. One is the default "index" function, and the other one is a function called "submit".

So, if I open "http://website/admin/browse_deals/", the default "index" function loads, which is fine. But, if I open "http://website/admin/browse_deals/submit/", again the "index' function is called instead of the "submit" function. No matter what the argument after "http://website/admin/browse_deals/" is, I always get the "index" function loaded. I am going crazy. I have no redirects or anything.

It is interesting to mention that in this folder I have a different controller which also has an "index" and a "submit" functions, and that one works perfectly, loading the "submit" function.

Please help. I have no idea why this is happening.

Thanks!
Alex