[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:
<?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
?>
Thanks, in advance.