You're concatenating the string wrong, you should use dots:
EDIT
After some googling I found out that it is apparently OK to concatenate with commas also, I did not know that...
echo "text".$variable."text".$variable2; //and so on.
EDIT 2
Apparently echo can take multiple parameters, which is what happens when you pass in values by separating them with commas. And then it isn't really string concatenation, user ACJ pointed that one out.
I would however still go with the HEREDOC in this case or concatenate the string, probably to a variable and then echo it out.
Something to look for is that you escape double and single quotes correctly, this is a common problem when working with long strings, especially strings containing html.
Also you might want to check out Heredoc:
$variable = <<<EOT
Place your multiline string here
and dont forget to end it with the same as you started it.
EOT; //Must not be indented
You should check out this question also: Best practices working with long strings in PHP
Okay so to actually get to your problem, assuming that you've checked to see that logged_in() really evaluates to true
, then the only problem i can think of is that $user_data does not contain a key named username
.
I'd start with enabling error_reporting by calling the following at the top of your file:
error_reporting(E_ALL | E_STRICT) //reports all errors.
And then you should get a pretty quick answer to what is wrong with your code, because it runs just fine on my computer.