Welcome Guest, Not a member yet? Register   Sign In
Randomly redirects
#1

[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>
&lt;form action="&lt;?php echo site_url("ccenter/Console/updateConsole"); ?&gt;" method="POST" name="submitform"&gt;

      <div>
      &lt;input id="post_title" name="console_name" type="text" size="30" tabindex="1" value="&lt;?php echo $details-&gt;console_name; ?&gt;" />
      &lt;input type="hidden" name="id" value="&lt;?php echo $details-&gt;id; ?&gt;" />
      </div>
      <div>
      &lt;input type="submit" value="Update Console" /&gt;
      </div>

  &lt;/form&gt;    
    </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.


Messages In This Thread
Randomly redirects - by El Forum - 11-08-2010, 11:30 PM
Randomly redirects - by El Forum - 11-08-2010, 11:40 PM
Randomly redirects - by El Forum - 11-08-2010, 11:43 PM
Randomly redirects - by El Forum - 11-08-2010, 11:52 PM
Randomly redirects - by El Forum - 11-08-2010, 11:56 PM
Randomly redirects - by El Forum - 11-09-2010, 12:01 AM
Randomly redirects - by El Forum - 11-09-2010, 12:11 AM
Randomly redirects - by El Forum - 11-09-2010, 12:21 AM
Randomly redirects - by El Forum - 11-09-2010, 12:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB