Hi, I'm trying to make a User Profile Managment system. So there's a "Update Profile" page where the logged in user can change the settings. The password fields remain empty and if the user wants to change the password, he/she puts in new passwords in respective input boxes.
When the form is submitted, the server side checks if password fields have been filled. If Yes, then change the password after validating. If No, then just update the other records. Here's the code: if($this->RequestHandler->isPost(array('password', 'passwordagain', 'name', 'email', 'website', 'about'))) { if(!empty($this->data['User']['password']) AND !empty($this->data['User']['passwordagain'])) { if($this->data['User']['password'] == $this->data['User']['passwordagain']) { $this->User->saveField('password', md5($this->data['User']['password'])); } else { $this->set('msg', 'Passwords do not match'); } } else { // End of Password update $this->save(); } } The problem is that when I try to update the password with saveField(), a new record is added to the database, instead of updating the corresponding record. And when password fields remain empty, it is supposed to update the records with fields other than password, but it doesnt. I'd appreciate some help. Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~----------~----~----~----~------~----~------~--~---