Jump to content

[SOLVED] echoing session variables


BarneyJoe

Recommended Posts

This kind of follows on from another question, but am working backwards, and trying to simply echo some contents from a session.

 

So at the top of my page I have :

 

<?php
session_start();
?>

 

And, using dreamweaver, have my session variable all looking present and correct in the applications > bindings panel.

 

So I presumed all I need to do to echo any of these variables is :

 

<?php echo $_SESSION['username']; ?>

 

..except nothing is displaying.....?

Link to comment
https://forums.phpfreaks.com/topic/40026-solved-echoing-session-variables/
Share on other sites

Thanks for the suggestions.

 

What I did in the end was look at the profile page - it uses a recordset, and then displays the email from the matching logged in user.

 

So i used the same recordset, and it's doing what i want now - although I'm still not sure exactly why the session variables are available in that way, but won't simply display using echo. (it didn't like the curlies.)

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.