Welcome Guest, Not a member yet? Register   Sign In
How to redirect Controller?
#1

[eluser]murtuza54[/eluser]
Hi Friends,

I am new to CI. and I have a little problem or say confusion.

I have controller login and findex.
from login/index function, if i redirect controller to findex, it redirects easily.

but when i redirect from login/check function to findex. it goes login/findex..

so it thinks findex as a function. how to declare that its another controller?

i write header("Location:findex");
is it proper way to redirect ?

-Murtuza..
#2

[eluser]Senthilguru[/eluser]
Hi dude,

just try this,


load url helper in your controller function
Code:
$this->load->helper('url');

use this function to redirect in your controller function
redirect('controller_name/function_name');


Cheers,
senthilguru.e
cogzideltemplates.com
#3

[eluser]chakhar86[/eluser]
another method:
-make those 2 controllers to be just 1 controller with different function name
-add a condition to pick one of those controllers
#4

[eluser]murtuza54[/eluser]
Thanks friends for reply...




Theme © iAndrew 2016 - Forum software by © MyBB