Welcome Guest, Not a member yet? Register   Sign In
How to return user to previous page with the same url
#4

[eluser]InsiteFX[/eluser]
I save the url in the users session and then upon logging in redirect back to the page that they last clicked. You can use the same idea, save to the users session in the string you want to redirect to, and also what data. Then in your controller that will handle the redirect, use both pieces of information in the Controller to handle it.

Here is an example:
Code:
$this->session->set_userdata('redirect_uri', 'after_redirect_controller'); //What page to go to after redirect controller
$this->session->set_userdata($data);
redirect('redirect_controller');

//Redirect Controller
function index()
{
  $redirect_uri = $this->session->userdata('redirect_uri');
  
  //Do something with other variables from session here

   redirect($redirect_uri);
}


Messages In This Thread
How to return user to previous page with the same url - by El Forum - 01-25-2013, 12:17 PM
How to return user to previous page with the same url - by El Forum - 01-25-2013, 12:31 PM
How to return user to previous page with the same url - by El Forum - 01-25-2013, 03:16 PM
How to return user to previous page with the same url - by El Forum - 01-26-2013, 07:33 AM
How to return user to previous page with the same url - by El Forum - 01-26-2013, 07:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB