Global functions

#11
[eluser]mabright[/eluser]
OK. I tried this with error below.

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: CI

Filename: libraries/Location.php

Line Number: 31
A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: libraries/Location.php

Line Number: 31

Fatal error: Call to a member function userdata() on a non-object in

Code:

Code:
class Location {
    
    var $user_location;
    
    public function __construct()
    {
        $CI =& get_instance();
        $this->user_location = $this->get_user_location();
        ...
    }
    
    function get_user_location()
    {
        if($CI->session->userdata('location') == TRUE)
        {
            return $CI->session->userdata('location');
        }
        else
        {
                 ....


Messages In This Thread
Global functions - by El Forum - 08-18-2010, 09:02 PM
Global functions - by El Forum - 08-18-2010, 11:44 PM
Global functions - by El Forum - 08-19-2010, 12:15 AM
Global functions - by El Forum - 08-19-2010, 07:30 AM
Global functions - by El Forum - 08-19-2010, 07:37 AM
Global functions - by El Forum - 08-19-2010, 07:45 AM
Global functions - by El Forum - 08-19-2010, 07:55 AM
Global functions - by El Forum - 08-19-2010, 08:31 AM
Global functions - by El Forum - 08-19-2010, 10:04 AM
Global functions - by El Forum - 08-19-2010, 10:27 AM
Global functions - by El Forum - 08-19-2010, 10:29 AM
Global functions - by El Forum - 08-19-2010, 10:39 AM
Global functions - by El Forum - 08-19-2010, 10:43 AM
Global functions - by El Forum - 08-30-2010, 11:06 AM
Global functions - by El Forum - 08-30-2010, 01:26 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.