Re: 1 last error to fix before the application is done!
| From: | Colin Guthrie | Date: | Tue, 14 Oct 2008 12:38:20 +0000 |
| Subject: | Re: 1 last error to fix before the application is done! | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-281857@lists.php.net to get a copy of this message | ||
Jochem Maas wrote:
Jason Pruim schreef:Or, seeing as I'm a stickler for compact code: if(!empty($_SESSION['userInfo']['loggedin'])) { empty() is like isset() but tests for all sorts of "empty" cases ('', false, null and 0 are all considered, "empty"). Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/]Good morning everyone! I think I might be having a "to early in the morning/not enough caffeine" moment... But I am down to 1 error on my timecard application that I would like to clean up. It's a small undefined index error, and the program works jsut fine the way it is, but why leave an error if you don't need to? :) Here is the error: [Tue Oct 14 08:19:47 2008] [error] PHP Notice: Undefined index: userInfo in /Volumes/RAIDer/webserver/Documents/dev/stimecard/inc/function/authentication.func.php on line 22 and here is the relevant code:if(isset($_SESSION['userInfo']['loggedin']) && $_SESSION['userInfo']['loggedin'] == TRUE) {======> Line 22 if($_SESSION['userInfo']['loggedin'] == TRUE) {