How to add the logged in user to a contact form 
Autor: Vagn M.
Visitado 43,
Followers 1,
Compartido 0
I am trying to figure out how I can add a username a logged in user to a contact form.
Is it possible or do I need to develop a contact form myself?
Best Regards
Vagn Majland
Publicado en
Hello Vagn,
Into your page add an HTML object and copy paste this code.
<?php
$pa = Configuration::getPrivateArea();
$user = $pa->whoIsLogged();
echo "Bienvenue : ".$user['realname'];
?>
<br> </br>
<?php
$pa = Configuration::getPrivateArea();
$user = $pa->whoIsLogged();
echo "Bienvenue : ".$user['username'];
?>
<br> </br>
<?php
$pa = Configuration::getPrivateArea();
$user = $pa->whoIsLogged();
echo "Bienvenue : ".$user['uid'];
?>
Here 3 different displaying
And VERY IMPORTANT. The page needs to be private for the user / group
And the result is:
Hope this helps
Axel