Welcome Guest, Not a member yet? Register   Sign In
The right way to redirect
#6

[eluser]zoonix[/eluser]
Thanks again for the help. Here's what I came up based of the suggestions. Pretty basic, but maybe it'll help some other newb like me.

Controller...
Code:
// Delete file
function delete_file($file) {
    unlink('./upload/test/'.$file);
        
    // Set the status message and redirect to index
    $this->session->set_flashdata('message', $file.' deleted');
    redirect('dev/test', 'refresh');
}

View...
Code:
<p>&lt;?php
    if($this->session->flashdata('message') != '' ) {
        echo $this->session->flashdata('message');
    }
    else {
        echo 'No Message';
    }
?&gt;</p>


Messages In This Thread
The right way to redirect - by El Forum - 04-16-2010, 01:28 PM
The right way to redirect - by El Forum - 04-16-2010, 01:37 PM
The right way to redirect - by El Forum - 04-16-2010, 02:34 PM
The right way to redirect - by El Forum - 04-16-2010, 03:46 PM
The right way to redirect - by El Forum - 04-16-2010, 03:49 PM
The right way to redirect - by El Forum - 04-19-2010, 06:56 AM
The right way to redirect - by El Forum - 04-19-2010, 06:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB