Welcome Guest, Not a member yet? Register   Sign In
Very weird array problem
#1

[eluser]frist44[/eluser]
I have created a few applications using some similar methods and found some issues with this particular one that I was never able to pinpoint. I have a view function that showing some information about an upload.

I do a check to see if info exists for that particular ID, and if it doesn't, redirect to a different page, which in turn shows some message based on flash data in the session library.

Code:
public function view($uploadid = FALSE) {
        
        // If not id is specified, go home
        if (!$uploadid) redirect(base_url());
        
        $data['upload'] = $this->uploads_model->get_upload($uploadid);
        
        // If not data is found with that ID, show error
        if (empty($data['upload'])) redirect_with_error(base_url(), 'flash_error_upload_view');
        
        $data['content_view'] = 'upload_view_view';
        $this->load->view('container_view', $data);        
    }

So when I first go to the page, everything looks normal, if I refresh the page, I get the error message showing as though the condition if (empty($data['upload'])) is satisfied however it doesn't do the redirection, just shows the message. That's the only place that message is referenced, so it has to be from that call.

Any idea????


Messages In This Thread
Very weird array problem - by El Forum - 04-21-2010, 12:55 PM
Very weird array problem - by El Forum - 04-21-2010, 04:46 PM
Very weird array problem - by El Forum - 04-22-2010, 03:00 PM
Very weird array problem - by El Forum - 04-22-2010, 03:06 PM
Very weird array problem - by El Forum - 04-22-2010, 03:08 PM
Very weird array problem - by El Forum - 04-22-2010, 03:24 PM
Very weird array problem - by El Forum - 04-22-2010, 05:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB