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

[eluser]matt2012[/eluser]
I want to do something like this in the controller (see below),

but if I have nothing stored in $data['message'] I get Undefined index: message

is this bad code or should I just disable notice warnings?

Code:
activation
{

            $data['message'] = 'Activation complete. You can now start your plan.';
        $this->index($data);
}

index
{

if($data['message']) {
        if($this->input->post('login') == ''){
        $data['message'] = 'please login.';
         }
         else {
         $data['message'] = ''; }
     }

}


The second issue is how can I store

$data['message'] = 'something';

in the default::controller variables registered there dont seem to be available to other controllers.

Sorry for asking two questions..


Messages In This Thread
Undefined index - by El Forum - 06-30-2007, 09:50 AM
Undefined index - by El Forum - 06-30-2007, 11:22 AM
Undefined index - by El Forum - 06-30-2007, 04:28 PM
Undefined index - by El Forum - 06-30-2007, 11:57 PM
Undefined index - by El Forum - 07-01-2007, 04:16 AM
Undefined index - by El Forum - 07-01-2007, 06:15 AM
Undefined index - by El Forum - 07-01-2007, 10:20 AM
Undefined index - by El Forum - 07-01-2007, 02:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB