Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to get User Name automatically in to text box
Chanux
✭✭
im going to create a contact us page using custome page plugin
i want to add username, to "name text box" automatically (Only Login User)
How can i do it
0
Answers
hi @Chanux
you could try
<input type="text" value="<?php echo $Session->User->Name; ?>" name="username" />
Not Working
@Chanux before the custom page declare the session first:
$Session = Gdn::Session();
afterwards you can put session variables anywhere like:
<input type="text" value="<?php echo $Session->User->Name; ?>" name="username" />
yes.. it is working now.. Thanx
@Chanux welcome just a friendly suggestion, after getting an answer you could vote it for "awesome" or "insightful" to help other people see the answer to your question faster
OK frnd.. i only clicked Did this answer the question? Yes • No