How to prnt logged in user name in the text field in a form

Discussion in 'PHP' started by digitalarts, Aug 5, 2009.

  1. #1
    How to print/show a logged in user name into a text filed in a form using php???????????

    what I want to do is, as soon as user go to the form and want to submit, there is a filed called user name, which I want to be automatically filled up from user login details...

    Please show me some ways how to do this?
     
    digitalarts, Aug 5, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Assuming you save the username in the session when the user logs in, you just have to do:

    echo htmlspecialchars($_SESSION['username']); ?>
    PHP:
     
    premiumscripts, Aug 5, 2009 IP