Welcome Guest, Not a member yet? Register   Sign In
HELP ME
#1

[eluser]Unknown[/eluser]
Using CI ,I write code like this:
Code:
function index()
{
$this->load->Model('missionmod');
$banner = $this->missionmod->status();
if($banner['status']==0)
{
  $this->_startmission(); // this function change $banner['status'] to 1 echo 1;
}
else
{
  $this->_missionloop(); // echo 2;

}
}
when I visit this page a second time in few seconds,supposing to get the "2" by function _missionloop(), it sends the same "1" by function _startmission() like the first time.
why it happens and what can I do to this?
"$this->output->cache()" is not been used .
I'm a Chinese and apologize for my poor English.
#2

[eluser]InsiteFX[/eluser]
Then your web browser is caching your pages and you would need to send a no-cache header before outputing again.

Code:
this->output->set_header("HTTP/1.0 200 OK");
$this->output->set_header("HTTP/1.1 200 OK");
$this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT');
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");
$this->output->set_header("Cache-Control: post-check=0, pre-check=0");
$this->output->set_header("Pragma: no-cache");
#3

[eluser]summanerd[/eluser]
seraphetx, where is the banner["status"] being saved?

It looks like start mission and mission loop are methods within your controller, not a part of the model. I guess I'm not seeing the connection of how you're storing that value.




Theme © iAndrew 2016 - Forum software by © MyBB