Welcome, Guest

Echo username in form "Name"
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Echo username in form "Name"

Echo username in form "Name" 3 years, 7 months ago #1384

Hi Muffinman,

thanks for your earlier solution for my problem. It seems to work. Just a simple one, I don't know the syntax: what do I have to type in the field 'Value' of a text-field to show automatically the name of the logged in user? SOmething like

<?php
global $user;
echo $user->name;
?>

?

Thanks,

Jan
  • Beeethoven
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0

Re:Echo username in form "Name" 3 years, 7 months ago #1385

try this

echo JFactory::getUser()->get('username'); // or 'name', I forget that always ,)
  • TheMuffinMan
  • Page:
  • 1
Moderators: TheMuffinMan, ForumSupport
Time to create page: 0.25 seconds

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany