Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional PHP Design Patterns
This is the forum to discuss the Wrox book Professional PHP Design Patterns by Aaron Saray ISBN: 978-0-470-49670-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional PHP Design Patterns section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 2nd, 2011, 03:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapt 22 - manage.php

On my server I have notices turned on, I was noticing that I get the following errors when I select the "Add User" link from the users page.

Code:
Notice: Undefined index: user in /views/default/users/manage.php on line 8
Notice: Undefined index: user in /views/default/users/manage.php on line 14
Notice: Trying to get property of non-object in /views/default/users/manage.php on line 14
Notice: Undefined index: user in /views/default/users/manage.php on line 27
Notice: Trying to get property of non-object in /views/default/users/manage.php on line 27
I have gone in and added isset($view['user']) functions throughout the code, is there a better way to handle this?
  #2 (permalink)  
Old February 2nd, 2011, 06:43 PM
Wrox Author
Points: 118, Level: 2
Points: 118, Level: 2 Points: 118, Level: 2 Points: 118, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2009
Location: Milwaukee, WI
Posts: 15
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Probably using isset() is the best solution. You could also make some sort of dynamic object with magic methods to return blank when queried, but that's way overkill. Good catch!
__________________
-aaron
--
aaronsaray.com || <-- yeah... try it.


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Express OK in Ch 22 Nick Y BOOK: Ivor Horton's Beginning Visual C++ 2005 0 August 4th, 2006 01:34 PM
Listing 22-6 bpdsmark BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 2 March 26th, 2006 01:29 PM
addhandler catch 22 roog ASP.NET 1.0 and 1.1 Professional 2 February 20th, 2006 01:01 PM
string formatter = "{0,22} {1}"; //what it mean? fukchai2000 C# 1 January 6th, 2006 08:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.