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
Post a Comment