I have placed below codeigniter code for controller and view.When a user logout the back button should not go to previous page.But i my case it moves to previous page.Pls help me to solve the issue.
Controller login:
function index()
{
$data['main_content'] = 'login_form';
$this->load->view('includes/template', $data);
}
function logout()
{
$this->session->sess_destroy();
$this->index();
}
view:login_form
<html>
<head>
<SCRIPT type="text/javascript">
window.history.forward();
function disableBack()
{
window.history.forward();
}
</SCRIPT></head>
<title>login_form</title>
<BODY onload="disableBack();" onpageshow="if(event.persisted) disableBack();"><div class="container">
<div class="row">
<div class="span4 logo">
<img src="<?php echo base_url('img/logosl.png'); ?>" style="margin-bottom:7px; margin-top:7px;"/>
</div>
<?php $this->load->view('includes/header'); ?>
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/style1.css" />
<div id="login_form">
<h1>Login!</h1>
<?php
echo form_open('login/validate_credentials');
echo form_input('username', 'Username');
echo form_password('password', 'Password');
echo form_submit('submit', 'Login');
echo anchor('login/signup', 'Create Account');
echo form_close();
?>
</div><!-- end login_form-->
<?php $this->load->view('includes/footer'); ?>
</body>
</html>