php - How can i display a username as a link -


i little new php. trying display username logged in link home page. have.

if (loggedin()) {     echo '<a href="homepage.php"> $user->get_fullname($uid) </a>' ;     echo '<a href="logout.php"> log out </a>'; } 

but can see not display username, display have in between link. not know go here.

you want:

if(loggedin()){          echo  '<a href ="homepage.php">'. $user->get_fullname($uid) .'</a>' ;          echo  '<a href="logout.php"> log out </a>';         }     else {  ?> 

in php single quotes not parse variable. alternative syntax is:

echo  "<a href ='homepage.php'> $user->get_fullname($uid) </a>" ; 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -