Change
This
<?php
if($user->getSession()){
echo '<li><a href="index.php?page=25&id=<?php echo $user[id]; ?>">My Profile</a></li>';
}else{
echo '<li><a class="button" href="#prvi">Join Us</a></li>';
}
?>
Into this
<?php
if($user->getSession()){
echo '<li><a href="index.php?page=25&id='.$user[id].'">My Profile</a></li>';
}else{
echo '<li><a class="button" href="#prvi">Join Us</a></li>';
}
?>
PHP tag is not necessary inline of echo, that is your error.
Update
The $user
variable is a object but used as an array.
In you code, change
echo '<li><a href="index.php?page=25&id='.$user[id].'">My Profile</a>
to this
echo '<li><a href="index.php?page=25&id='.$user->id.'">My Profile</a>
In object you have to refer to its key with ->
as in arrays you do []