[eluser]sanct_arvin[/eluser]
redirect it to another page.
Code:
$query = $this->db->insert('users', $_POST);
$user_id = $this->db->insert_id();
$data['msg'] = 'Successfully Registered: '.$_POST['lname'].', '.$_POST['fname'];
$data['title'] = 'Successful'; //title of the page
$data['sec'] = 5; //secs before redirection
$data['heading'] ='Successfully Registered'; // heading :D
$data['url'] = base_url().'index.php/user/nextlocation'; //your next location
$_SESSION['user_id']= $user_id; //set session variable to check if he/she is logged in
$this->load->view('prompt.php', $data);
create a redirection page
in your prompt.php
Code:
<html>
<head>
<title><?=$title?></title>
<meta http-equiv="refresh" content="<?=$sec?>;url=<?=$url?>">
<style>
td, th, pre, body, input, textarea, span, div, p{
font-family: Verdana, Arial;
font-size: 11px;
vertical-align:top;
}
.main{
display: inline;
width: 95%;
}
.right{ width:100%}
.left{ padding-left: 10px; padding-right: 10px;}
.msg{border:1px dashed fff }
</style>
</head>
<body>
<?=$sec?>
<?=$url?>
<h3><?=$heading?></h3>
<div class='msg'>
<?=$msg?>
</div>
</body>
</html>
i use it every time i don't want a duplicate data
you can use it in every pages that would insert data.
kudos!
regards
- sanct_arvin