hi, i'm trying to edit something on a site i didn't code myself so i downloaded the files and set them up on a virtual host on my local machine. i am using wamp server with php v 5.2.9-2. the problem is when i go the page on my local machine i get this error:
Notice: Trying to get property of non-object in C:\wamp\www\yikers\common\browser.php on line 18
here is the code:

public function isIE()
    {
        $b = get_browser();
        
        if ($b->parent == 'IE 6.0' || $b->parent == 'IE 5.5' || $b->parent == 'IE 5.01')  //this is line 18
            return true;
        else
            return false;
    }

does anyone know what the problem could be?

Recommended Answers

All 3 Replies

The problem is that get_browser returns an array, not an object. use $b['parent'] , not $b->parent

Try the following:

public function isIE()
    {
        $b = get_browser(null, true);
        
        if ($b['browser']=='IE')
            return true;
        else
            return false;
    }

thanks man, that was the problem. works fine now..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.