Welcome Guest, Not a member yet? Register   Sign In
Codeigniter - redirect

hi there,

i face a problem when using redirect function.

What i want to do redirect if user successfully login.

if (!$userID) {
$this->session->set_flashdata('login_error', TRUE);
} else {

'logged_in' => TRUE,
'userID' => $userID,
'username' => $username));


however,the new link is like that
<a href="http://www.ressim.net/i/5512048_painterror-png.html"><img src="http://img1.ressim.net/out.php/i5512048_painterror-png" alt="Ucretsiz Resim yukle ve Paylas" border="0" /></a>


What is the URL supposed to be?

Are you loading the URL helper before you use the redirect function?


yes i load it in constructor

for example
i write redirect("base_url()")
it makes

what i want to do is making it

why i dont know but i appends to former url.


because you are only supposed to put the segments in redirect() (see the docs), you are putting base_url() so it's the whole url getting appended to the current url.


The docs say:
Quote:If you specify the full site URL that link will be build,

I'm just clarifying that if you supply a whole url it won't redirect to the url supplied?

Not on topic but if I read it right your statement is not correct based on the above quote. The language is off so it might be incorrect in my thinking...

Your orignal posts has "welcome_page" I'm assuming that's a controller? If not you must put the controller before the method name. redirects direct to a url not a view (that was one of my initial issues with CI.)

Theme © iAndrew 2016 - Forum software by © MyBB