Re: [PHP] Re: 1 last error to fix before the application is done!
- From: japruim@xxxxxxxxxx (Jason Pruim)
- Date: Tue, 14 Oct 2008 08:43:49 -0400
On Oct 14, 2008, at 8:38 AM, Colin Guthrie wrote:
Jochem Maas wrote:Jason Pruim schreef:Good morning everyone!if(isset($_SESSION['userInfo']['loggedin']) && $_SESSION['userInfo'] ['loggedin'] == TRUE) {
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:
======> Line 22 if($_SESSION['userInfo']['loggedin'] == TRUE) {
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").
Hey Colin,
Does the ! reverse the empty in this case? such as !empty = not empty?
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
japruim@xxxxxxxxxx
.
- Follow-Ups:
- Re: [PHP] Re: 1 last error to fix before the application is done!
- From: Wolf
- Re: 1 last error to fix before the application is done!
- From: Colin Guthrie
- Re: [PHP] Re: 1 last error to fix before the application is done!
- References:
- 1 last error to fix before the application is done!
- From: Jason Pruim
- Re: [PHP] 1 last error to fix before the application is done!
- From: Jochem Maas
- Re: 1 last error to fix before the application is done!
- From: Colin Guthrie
- 1 last error to fix before the application is done!
- Prev by Date: Re: [PHP] PHP to get File Type
- Next by Date: BarcodeDB.com - a Barcode Database
- Previous by thread: Re: 1 last error to fix before the application is done!
- Next by thread: Re: 1 last error to fix before the application is done!
- Index(es):
Relevant Pages
|