i have a cakephp web app that i'm developing. I have a UsersController.php file,which handles all users registrations and logins. When a user is logged in,he can use the functionality of FeaturesController.php. The FueaturesController.php has a view file,the create.ctp . In create.ctp,the user inserts some data into an HTML form and these data are saved into a database,using $this->Modelname->save($this->request->data).
NOW,i want to add into a field of the database the username of the user that did/used that HTML,but till now i have not succeed! My code looks like this:
$username = $this->Session->read('Auth.User.username');
so that i save the username of the user into the variable $username.
But now,how can i insert it into the database? I have tried various ways but it didn't work :/
Anyone's help is welcomed,thank you in advance :)