The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Getting username?

Discussion in 'cPanel Developers' started by rpope904, Dec 24, 2008.

  1. rpope904

    rpope904 Registered

    Joined:
    Dec 12, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I am writing a new script for our host cPanel, and I need to be able to display the current users' cPanel login name.. I have tried <cpanel print="USER"> and that just showed USER on the page.. How could I do this?
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Here's the code that'll do the trick for you:

    <cpanel print="$ENV{'REMOTE_USER'}">

    Note, anything without a $ will be treated as a string literal. So the code <cpanel print="USER"> will literally print USER.
     
Loading...

Share This Page