I have this function:
public function showCredentialsPhoto(){
if (isset($_SESSION["logado"]) && $_SESSION["logado"] === TRUE && (!empty($_SESSION['avatar']))):
echo "<img class='nav-user-photo' src='<?php echo $_SESSION['avatar'];?>'/>";
else:
echo "<img class='nav-user-photo' src='galeria/sistema/user.png'>";
endif;
}
But when I call it it gives error:
(!) Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C: \ wamp \ class.User.php on line 196 < p>
Why? How can I fix this?
Line 196 is this:
echo "<img class='nav-user-photo' src='<?php echo $_SESSION['avatar'];?>'/>";