Welcome Guest, Not a member yet? Register   Sign In
retaining a value in a controller variable
#2

[eluser]bhogg[/eluser]
Could just use a session variable, in function A:

Code:
$this->load->library('session');
$this->session->set_userdata('my_id', $id);

Then in function B, C, D:

Code:
$this->load->library('session');
$this->session->userdata('my_id');

As a side note the id should probably be validated in function A otherwise a user could just change the URL and set whatever ID they would like.


Messages In This Thread
retaining a value in a controller variable - by El Forum - 06-19-2010, 06:59 AM
retaining a value in a controller variable - by El Forum - 06-19-2010, 10:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB