CodeIgniter Forums
Pass a variable of a controller to another controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Pass a variable of a controller to another controller (/showthread.php?tid=55723)

Pages: 1 2


Pass a variable of a controller to another controller - El Forum - 11-08-2012

[eluser]PhilTem[/eluser]
For quickly fixing your code to not produce the session error, do the following:

Before the first echo, make
Code:
$content = "";

Replace every
Code:
echo "
with
Code:
$content .= "

Then, after you set the session, do

Code:
$this->output->set_output($content);

This way you don't need to massively alter your code.


Pass a variable of a controller to another controller - El Forum - 11-08-2012

[eluser]masentinel900[/eluser]
My friend many thanks, For the mistake of the pass the variable through set_userdata works very good. Already donĀ“t show me the logs error..

But Right now I have two new issues..

1: Please, do you can explain me a few better what did the before script..

2: When I generate the rows of the dynamic table, I need get a data from this controller and pass to download controller for may to download the corresponding file. I already can get it with the set_userdata but always get the same data. I need that pass the data corresponging to the file selected.

I'm doing a downloads managements and by this I need make it..
What another way do you will do it..