Welcome Guest, Not a member yet? Register   Sign In
User library issue, calling CI Library (session)
#1

[eluser]skrobma[/eluser]
I created my own library and I'm trying to access information in my session, but I getting the following error. What am I doing wrong? (PHP5/MYSQL5(WAMP5:1.7.3), CI:1.6.1)):

Code:
<p>Severity: Notice</p>
<p>Message:  Undefined variable: CI</p>
<p>Filename: libraries/Podclass.php</p>
<p>Line Number: 20</p>

Podclass.php
Code:
&lt;?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

class Podclass {
    
    /**
     * Constructor
     *
     */    
    function Podclass()
    {    
        $CI =& get_instance();
         $CI->load->library('session');
    }
    
    function lerror()
    {
        $errors = array(0=>' ',1=>
            "<DIV class='error'> Invalid UserID/Password </DIV>",2=>
            "<DIV class='error'> You don't have access to this pod.</DIV>");
            return $errors[$CI->session->userdata('lerror')];
        
    }

}
// END podclass Class
?&gt;

Thanks, in advance.


Messages In This Thread
User library issue, calling CI Library (session) - by El Forum - 02-24-2008, 02:18 PM
User library issue, calling CI Library (session) - by El Forum - 02-24-2008, 02:42 PM
User library issue, calling CI Library (session) - by El Forum - 02-24-2008, 02:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB