Passing $_SESSION Variables
-
I am having problems passing varriables from my non word press section to word press and also within word press.
the following code is part of a side bar and half of the time it picks up the $_SESSION[‘user’] and displayes it and half of the time it doesn’t.
<div class=”logst”><center>
<?php if (isset($_SESSION[‘user’])) { ?>
<center>Logged in as <span class=”namlb”>
<?php echo $_SESSION[‘user_name’]; ?> </span>
Settings | Logout </center></div>
<?php } ?> <?php if (!isset($_SESSION[‘user’])) { ?>
<p class=”logst”>MembersSection
Login | Sign Up </p>
<?php } ?>Then in the main body of a word press page I have:
<h1>Registration</h1><div>
<table>
<tr><td class=”logtb” style=”width:250px;”><div align=”center”><font class=”Logh”>My Account</font></div>
Logged as <?php echo $_SESSION[‘user_name’]; ?> | Settings | Logout <?php } ?> </td></tr></table>
</div>And it never finds the
$_SESSION[‘user_name’]Any Help would be appreciated.
- The topic ‘Passing $_SESSION Variables’ is closed to new replies.