isset on multi-dimensional arrays

    Date: 01/23/06 (PHP Community)    Keywords: no keywords

    This may or may not be the best way to do this, but now I am curious.

    I have this function call:

    if(!auth_user($_SESSION['USER']['AUTH']['username'], $_SESSION['USER']['AUTH']['password']))
    {		
         graceful_exit();	
    }
    


    to verify a users username and password is stored. I am getting undefined index errors because some of those keys may not exist when calling the function. So how do I verify that 'USER', 'AUTH', 'username' and 'password' are present?

    I cant do this:

    if(!isset($_SESSION['USER']['AUTH']['username']))
    {
       graceful_exit();
    }
    


    because I get same errors.

    Any advice would be appreciated.

    Thanks

    Source: http://community.livejournal.com/php/400681.html

« UK PHP Programmer Job Ad || Download script for mp3s »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home