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