How to fix default controller redirect |
[eluser]titolancreo[/eluser]
Hi! I'm new programming with codeigniter and I was solving all problems I had by myself, but now, I need some help. Yesterday I was surfing my web whitout problems until I had one with ajax. I couldn't go to controller so I think that was the problem, but this morning, my session has expired and I notice that when I try to log in, it always load my default controller. I think the problem starts because I was changing a lot of things in order to configure xdebug for netbeans. Here is my code: config: Code: $config['uri_protocol'] = 'REQUEST_URI'; htaccess: Code: RewriteEngine on routes: Code: $route['default_controller'] = "login"; (controller) login: Code: function index() (view) login_view: Code: <?php $attributes = array('onsubmit' => 'return checkLog();', 'id' => 'formLogin'); And I want to go to verifylogin but I don't know why, if I debug it, It goes always to login Thanks a lot for your answers!!!
[eluser]titolancreo[/eluser]
[quote author="Otemu" date="1364209245"]Can we see your verifylogin controller??[/quote] Yes, but it never goes there. I have breakpoints in login and verifylogin and it only stops in login, so that's not the problem... Yesterday, when I tried to logout, I could login again, and I didn't change anything in that controller. Code: function index() I have $this->input->post('submitLogin') because I have two forms on login_view
[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums! In your.htaccess file, change this: Code: RewriteRule ^(.*)$ index.php/$1 [L] to this: Code: RewriteRule ^(.*)$ index.php?/$1 [L] You may also need to change the following: Code: $config['uri_protocol'] = 'REQUEST_URI'; // Try the other possible values. I suspect your server is misinterpreting the request URI.
[eluser]titolancreo[/eluser]
[quote author="TheFuzzy0ne" date="1364210768"]Welcome to the CodeIgniter forums! [/quote] Thanks!! I hope I'll learn a lot here ;-) It doesn't work, I'm desperate... I also have Code: $config['enable_query_strings'] = TRUE; Watching source code, i found that I have this action Code: http :// localhost/PFC/?verifylogin Code: http :// localhost/PFC/verifylogin it works, but it is created by the form_open('verifylogin', $attributes). Any ideas?
[eluser]TheFuzzy0ne[/eluser]
Are you sure you want to enable query strings? By default, they're disabled, so your URL would be something like: http://localhost/controller/method/arg1/arg2 With query strings enabled, your URL would be more like: http://localhost/?c=controller&m=method&...g&arg2=arg Is that what you want?
[eluser]titolancreo[/eluser]
I know it, its only for debugging purpose because netbeans (xdebug) needs to send its session
[eluser]TheFuzzy0ne[/eluser]
I think that's why you have a problem. Is it really worth sacrificing clean URLs so you can use a debugger? The CodeIgniter profiler works just fine for me. Granted, it's not a debugger, but it helps with benchmarking.
[eluser]titolancreo[/eluser]
Thanks a lot! That was the problem... I change it to false and it works perfect. |
Welcome Guest, Not a member yet? Register Sign In |