CurrentUserInfo() does not print field value (v9)

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
atalie1922
User
Posts: 22

CurrentUserInfo() does not print field value (v9)

Post by atalie1922 »

Good afternoon. I am using phpmaker v9 and I want to fetch the information of the user logged-in in the system. I tried these code statements that I have seen in other posted topics:

echo $GLOBALS["Security"]->CurrentUserInfo("lastname");

if ( IsLoggedIn() )
{
echo CurrentUserInfo("lastname");

}

but it does not print anything. Thank you.


mobhar
User
Posts: 11768

Post by mobhar »

In which server event did you put the code?

Also, make sure the field name matches with the one in the table.


atalie1922
User
Posts: 22

Post by atalie1922 »

I am trying to use it in Page_DataRendering and Page_DataRendered event in List Page. Thank you for your reply.


mobhar
User
Posts: 11768

Post by mobhar »

Try this:

function Page_DataRendering(&$header) {
if ( IsLoggedIn() ) {
$header = CurrentUserInfo("lastname");
}
}

function Page_DataRendered(&$footer) {
if ( IsLoggedIn() ) {
$footer = CurrentUserInfo("lastname");
}
}


Post Reply