Welcome Guest, Not a member yet? Register   Sign In
cannot user redirect() function..
#1

[eluser]scorpioniz[/eluser]
cannot use redirect function after
Code:
$this->form_validation->run

i have function:

Code:
function edit($id = NULL){
  $user_id = 25;
  $event = $this->database->GetSingle('events', array('id' => $id, 'userid' => $user_id));
  $this->data['event'] = $event;
  //redirect('user/event/show/'.$event['id']);
  if($this->form_validation->run('event/createedit') == FALSE){
    $this->ajaxValidation('event/createedit');
  }else{
    if($event == NULL){
      $this->database->Insert('events', $data);
      $event_id = $this -> database -> GetLastID();


    }else{
      $this->database->Update('events', $data, array('id' => $event['id']));
      $event_id = $event['id'];
    }
    redirect('user/event/show/'.$event_id);
  }
}

and if i put redirect before
Code:
if($this->form_validation->run('event/createedit') == FALSE)
statement its redirecting me where i need..

plz help..

also i notice that it tries to redirect where i need, but than it re-redirects to the edit page..


Messages In This Thread
cannot user redirect() function.. - by El Forum - 09-12-2014, 07:26 AM
cannot user redirect() function.. - by El Forum - 09-12-2014, 09:12 PM
cannot user redirect() function.. - by El Forum - 09-13-2014, 07:15 AM
cannot user redirect() function.. - by El Forum - 09-13-2014, 08:28 AM
cannot user redirect() function.. - by El Forum - 09-13-2014, 09:00 AM
cannot user redirect() function.. - by El Forum - 09-13-2014, 09:20 AM
cannot user redirect() function.. - by El Forum - 09-13-2014, 09:28 AM
cannot user redirect() function.. - by El Forum - 09-13-2014, 09:36 AM
cannot user redirect() function.. - by El Forum - 09-13-2014, 04:17 PM
cannot user redirect() function.. - by El Forum - 09-13-2014, 04:19 PM
cannot user redirect() function.. - by El Forum - 09-13-2014, 04:51 PM
cannot user redirect() function.. - by El Forum - 09-13-2014, 07:08 PM
cannot user redirect() function.. - by El Forum - 09-15-2014, 12:22 AM
cannot user redirect() function.. - by El Forum - 09-15-2014, 01:12 AM
cannot user redirect() function.. - by El Forum - 09-15-2014, 05:39 PM
cannot user redirect() function.. - by El Forum - 09-15-2014, 06:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB