Sunday, December 28, 2008

Newby: "Undefined index" error

Hi,

Following on from an earlier post, I'm receiving an error when trying
to log in to a basic password protected admin system. The error is
as follows:

Notice (8): Undefined index: User [APP\controllers
\users_controller.php, line 10]

Code

if(!empty($this->data)) {

// find the user in the database

$dbuser = $this->User->findByUsername($this->data['User']
['username']);

UsersController::login() - APP\controllers\users_controller.php, line
10
Object::dispatchMethod() - CORE\cake\libs\object.php, line 115
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 245
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 211
[main] - APP\webroot\index.php, line 88


The erroring line is: $dbuser = $this->User->findByUsername($this->data
['User']['username']);


I'm new to cakephp, in fact new to php completely, so not sure how to
debug this at all!

Can anyone see why this error might be happening, or point me in the
right direction to be able to get more useful debugging info. I've
Googled the error and it doesn't seem to yield anything useful.

Thanks all!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: