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

twig - Using Twigbridge in a Laravel 5.1 Package -

Kivy: Swiping (Carousel & ScreenManager) -

jdbc - Not able to establish database connection in eclipse -