Writing welcome message with username PHP -


hi quick question, wandering how can output string alongside username generated using sessions

i want code : "welcome, (username)"

this code far outputs username of person logged in, want add "welcome" in front of username.

<?php    if (isset($_session['username'])){    echo '<div id="welcome_msg">'  .$_session['username']. '</div>';                                 } ?> 

you can add non-php content within quotes in echo statement like:

   echo '<div id="welcome_msg">welcome '  .$_session['username']. '</div>'; 

Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -