Welcome Guest, Not a member yet? Register   Sign In
Pass variable in redirect
#1

[eluser]limit[/eluser]
Is it possible to pass variables in a redirect? I have a callback process after a payment is made. If success I redirect to order complete and destroy the session, so cant carry the order ID via a session.

On the order complete page - I want to pass the order ID in the redirect and set it in the view.

Example: on the CI docs for the URL helper is shows something like below.

Code:
redirect('/article/13');

Would 13 be the variable passed? And if so how would I retrieve that in my view? I know I have to assign $data['order_id'] = '' in my controller, but I am wondering how I would retrieve the 13? Would that be get or would I use something like

Code:
$data['order_id'] = $this->uri->segment(2);
?


#2

[eluser]limit[/eluser]

Figured it out.

$data['order_id'] = $this->uri->segment(3); Works.




Theme © iAndrew 2016 - Forum software by © MyBB