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

[eluser]Tim Brownlaw[/eluser]
Well scorpioniz insists that the insert and updates are working indicating that execution is falling into the else block... Which I find a little hard to believe with the provided code sample as $data doesn't exist locally in the function and I cannot see where it's being defined.

So it's obvious that IF the else block is being executed somethings going BANG halting execution... Or the redirect would be getting executed... We're flying blind here!

So A Quick check would be to do this...
Code:
<?php if ( ! defined('BASEPATH') ) exit('No direct script access allowed');

class Someclass extends CI_Controller
{
  public function __construct()
  {
    parent::__construct();
  }

  public 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
    {
      $event_id = 1; // Set this to something valid for testing
      redirect('user/event/show/'.$event_id); // NOW Does this work when the Form is Valid???
    }
  }
}


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