[eluser]stuffradio[/eluser]
This is a weird problem I've been spending an hour trying to figure out.
It's a simple thing where it updates a field in the database.
The page:
Code:
<div class="clearfix">
<h2 class="ico_mug">Modify Console</h2>
<form action="<?php echo site_url("ccenter/Console/updateConsole"); ?>" method="POST" name="submitform">
<div>
<input id="post_title" name="console_name" type="text" size="30" tabindex="1" value="<?php echo $details->console_name; ?>" />
<input type="hidden" name="id" value="<?php echo $details->id; ?>" />
</div>
<div>
<input type="submit" value="Update Console" />
</div>
</form>
</div>
The console function
Code:
function updateConsole()
{
$this->load->model('consoles');
$console_name = $this->input->post('console_name');
$this->consoles->updateConsole($console_name, $this->input->post('id'));
redirect(site_url("ccenter/Console/detail/$console_name"));
}
The model function
Code:
function updateConsole($name, $id)
{
$data = array(
'console_name' => $name
);
$this->db->where('id', $id);
if ($this->db->update("igxpro_consoles", $data)):
return TRUE;
else:
return FALSE;
endif;
}
It redirects sometimes to ccenter/Members/logout, but no where in my code do I have something for redirecting to that page... only in the header for a user to click on to logout. It's really weird.