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

[eluser]welzai[/eluser]
Hi guys,

I am with problem.

i already searched, here at forum, but don't work my problem about redirect,

the problem is.

I want after insert in db redirect for outer page.

I find one post here but, don't resolved my problem.

my code is below

insert function
Code:
function Inserir()
      {
    $dados = array();
        //take next id of the table        
    $dados['IdFinanceira'] =  $this->Proximo_codigo('IdFinanceira','Financeira');
          
        if ($this->input->post('Nome'))
          $dados['Nome'] = $this->input->post('Nome');
    
    //insert function of model                  
        $this->Financeira->Inserir($dados);

        //redirect don't work this listar function is in same controller
        redirect('/Financeira_ctl/Listar/', 'refresh');
      }

now if i put redirect in begin of code work;

what should i to make ?
#2

[eluser]rogierb[/eluser]
If the Listar function is in the same controller as the Inserir function you can use $this->Listar().
This will load the Listar function. You don't need to redirect.

Just a quick tip, don't use capitals as some server setups might have a problem with serving them.
#3

[eluser]welzai[/eluser]
thanks rogierB, for your help,

but i already tried this way too.

and did not worked.
#4

[eluser]alrightythen[/eluser]
Did you call the url helper?
$this->load->helper('url');
#5

[eluser]welzai[/eluser]
yes i called !
#6

[eluser]welzai[/eluser]
i do not understand the why work at begin and do not work at end.

anyone know any other alternative to do it ?




Theme © iAndrew 2016 - Forum software by © MyBB