CodeIgniter Forums
Redirecting with $_POST - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Redirecting with $_POST (/showthread.php?tid=78770)



Redirecting with $_POST - motownphilippe - 03-08-2021

I would like to pass $_POST data on successful completion of a form. 

This will place my form data into $_SESSION as an array 

PHP Code:
redirect()->route('education')->with('report''Session Saved')->withInput(); 

I can get to this via 
PHP Code:
session('_ci_old_input')['post'

but not the individual values, for a reason I don't understand. 
It feels as though there must be a more elegant way to access '_ci_old_input' but I'm not sure what it is. 



How can I pass $_POST data on to a new page with redirect() ? 

Happy to try a different strategy. Flash Session data?


RE: Redirecting with $_POST - motownphilippe - 03-09-2021

How silly of me, I can just use
PHP Code:
set_value('var-name'

for some reason I thought I can only use set_value() in a view. Works fine in my controllers and classes.
Case closed.