• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URL after insert data

Hey guys,

After insert data in DB, the system returns to home page. OK. But, the url stay like 'http://localhost/code4/home/save'. If I refresh the page (F5), the insertation is made again. I want return to 'http://localhost/code4/' only. Do someone help me?

Code from the 'Home' controller:

public function save(){
$usuarioModel= new UsuarioModel();

$dados= $this->request->getPost();

$request= $usuarioModel->save($dados);

echo view('base/header');
//echo view('menu');
echo view('home/index');
echo view('base/footer');


Hello, use
PHP Code:
return redirect()->back(); 

you can read the documentation for the redirect function here https://codeigniter.com/user_guide/gener...t#redirect

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.