codeigniter redirect with data
There are two possible ways, you can pass values while redirecting the user. 1. Using Sessions: Use session to pass data while redirecting., The CodeIgniter URL Helper comes to the rescue with the redirect() function that performs a header redirect to the path you specify as a parameter. redirect( '/login/form/' , 'refresh' ); Just make sure you load the URL Helper prior to ex, In your case I would recommend you to use flash data. Is will be stored within the session but is only available for the next page load. Controller ..., So in the controller you can have in one function : $in=1; redirect(base_url()."home/index/".$in);. And in the target function you can access the ..., You can use codeigniter session's set_flashdata() method $body = $e->getJsonBody(); $err = $body['error']; $data['failure_response'] = $err; ..., You can pass it over session. If you want it available next request only, put it in session flash data. First controller public function ..., With a redirect the controller is really saying that this request needs to be dealt with by another controller. If your controller method has arguments, ..., when using redirect you go from one controller or another by this process all post data are destroyed unless you stored them on a session, here ...
相關軟體 .NET Framework 資訊 | |
---|---|
![]() codeigniter redirect with data 相關參考資料
Can I pass data to view if I use redirect in codeigniter ...
There are two possible ways, you can pass values while redirecting the user. 1. Using Sessions: Use session to pass data while redirecting. https://stackoverflow.com CodeIgniter: Passing data along with the redirect
The CodeIgniter URL Helper comes to the rescue with the redirect() function that performs a header redirect to the path you specify as a parameter. redirect( '/login/form/' , 'refresh'... https://www.webomelette.com Codeigniter: redirecting while passing data - Stack Overflow
In your case I would recommend you to use flash data. Is will be stored within the session but is only available for the next page load. Controller ... https://stackoverflow.com How to pass a data with redirect in codeigniter - Stack Overflow
So in the controller you can have in one function : $in=1; redirect(base_url()."home/index/".$in);. And in the target function you can access the ... https://stackoverflow.com How to Pass data by using redirect in codeigniter - Stack ...
You can use codeigniter session's set_flashdata() method $body = $e->getJsonBody(); $err = $body['error']; $data['failure_response'] = $err; ... https://stackoverflow.com how to sent parameter in redirect - php codeigniter - Stack ...
You can pass it over session. If you want it available next request only, put it in session flash data. First controller public function ... https://stackoverflow.com post data between controllers - CodeIgniter Forums
With a redirect the controller is really saying that this request needs to be dealt with by another controller. If your controller method has arguments, ... https://forum.codeigniter.com post data via redirect function in codeigniter - Stack Overflow
when using redirect you go from one controller or another by this process all post data are destroyed unless you stored them on a session, here ... https://stackoverflow.com |