Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    3

    Default Getting username?

    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. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by rpope904 View Post
    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?
    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.

Similar Threads & Tags
Similar threads

  1. Replies: 3
    Last Post: 12-20-2010, 07:46 AM
  2. New username
    By P4l4d7n in forum New User Questions
    Replies: 2
    Last Post: 05-26-2006, 10:15 AM
  3. Replies: 2
    Last Post: 02-03-2006, 04:23 PM
  4. username to username+domain with emails?
    By inov in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 12-28-2003, 07:49 AM
  5. Username already taken
    By HSAdam in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 02-15-2003, 10:04 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube