Simple question:
I’m using web users. I want to use php inside of my pages for custom code. I want to be able to know if someone is logged in. For example, if someone is logged in I want to display their information. How can I use php inside of my pages and how do I check to see if someone is logged in? I tried using
[tt]<?php
echo getLoginUserName( );
?>[/tt]
in one of my pages but the php wasn’t parsed. Please help. Thanks!
Thanks dev_cw. I had just figured this out. You have to use snippets to do PHP and the API functions need to start with $modx->. So, I created a new snippet that looks like this and it works:
[tt]
<?php
echo $modx->getLoginUserName( );
?>
[/tt]