-1

What is wrong here..

<?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>';                 
            } ?>

The result of this:

index.php?page=25&id=<?php%20echo%20$user[id];%20?>
  • 1
    `echo '
  • My Profile
  • ';` - the stuff between the single quotes is called a string literal. In single-quoted string literals php doesn't substitute variables , and it certainly doesn't "look for" other php script blocks - it's just a string literal and echo prints it (more or less) as-is.see http://docs.php.net/language.types.string – VolkerK Aug 23 '15 at 19:03