CodeIgniter Forums
How do you force redirect? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How do you force redirect? (/showthread.php?tid=29160)



How do you force redirect? - El Forum - 03-31-2010

[eluser]danbirlem[/eluser]
I have a form that after submitting I am trying to get it to go back to a fixed URL but it never seems to completely direct, only append the URL.

Here's the controller code:
Code:
function delete() {
        $this->Estimatemodel->delete_estimate();
        
        $html_head = array( 'title' => 'Estimate Management' );

        $estimates = $this->Estimatemodel->get_estimates();

        $this->load->view('html_head', $html_head);
        $this->load->view('estimates/view', array('estimates' => $estimates));
        $this->load->view('html_foot');
    }

The redirect() function within documentation doesn't work to append the URL, but I want a forced complete redirect to the URL.


How do you force redirect? - El Forum - 03-31-2010

[eluser]OliverHR[/eluser]
Redirect only work if you use it befor sending any header to client, Maybe you can you use in your header the html metatag refresh.

http://www.w3schools.com/tags/tag_meta.asp


How do you force redirect? - El Forum - 03-31-2010

[eluser]Afro Radio Head[/eluser]
Code:
$this->load->helper('url');

redirect("place/to/redirect");

This doesn't work? You can view the page at http://ellislab.com/codeigniter/user-guide/helpers/url_helper.html