This topic is locked

Use session variable in footer

6/19/2023 10:31:04 PM
PHPRunner General questions
A
asawyer13 authorDevClub member

Is it possible to show the value of a session variable in the footer?
I am wanting to show the database name in the footer.
I tried using <?php echo $SESSION["dbname"] ?> but it didn't work. I loaded the database name in the variable at successful login.
Probably something stupid I'm missing.
Thanks
Alan

fhumanes 6/20/2023

Hello,
I think you have made a syntactic PHP mistake.
Try to put:
...... $_SESSION['dbname'] .....
Greetings,

Admin 6/20/2023

The following should work:
<?php echo $_SESSION["dbname"] ?>If it doesn't, you need to refer to this article that explains how to access PHPRunner session variables in external files.
https://xlinesoft.com/phprunner/docs/how_to_add_external_files.htm

A
asawyer13 authorDevClub member 6/21/2023

the proper syntax from you guys worked.
Thanks
Alan