This topic is locked

how to add username to header

9/7/2014 11:58:28 PM
PHPRunner General questions
W
wfcentral author

I need to add code to my header file so it will display the username of the currently logged in user. How can I do this?

HJB 9/8/2014

Seems as if it is a job for the PHPR built-in VISUAL EDITOR by using the "Insert PHP code snippet" button from the top menu ..., adding { $_SESSION["UserName"] } (without the "}" then into the new window and you'r done! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=75604&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' />

W
wfcentral author 9/8/2014

I figured it out.
The header.php file will take regular PHP. So, I inserted <?php echo $_SESSION["UserName"]; ?>

into the header.php file.

Admin 9/8/2014

Open header file, switch to HTML mode and put the following there:

<?php

echo $_SESSION["UserName"];

?>