I want to create a simple Droplet and can't work out the Syntax.
I simply want to show the logged in user's name on the page. I've worked out that the variable I need is:
$_SESSION['USERNAME']. But what exactly to I put into the drplete box?
return $_SESSION['USERNAME']
or something else.
Thanks
Hmm, if variable is the right one i guess you forgot the ";" at the end :-D
return $_SESSION['USERNAME'];
I would extend this a little bit.
if (isset($_SESSION['USERNAME'])) {return $_SESSION['USERNAME'];}
else {return 'Guest';}
As a session is only created if a user is logged in, you wil get an error messabe if the variable does not exist.
Genius,
Thank you so much, the semi-colon did the trick.
Thanks for the idea about the non-logged in user - in this case the page is within the 'client area' but your code will be really useful in the future.
Thanks