A
Anonymous
Guest
Hi,
I’d just like to please, enquire if php coding has been changed which is stopping my menu from displaying properly?
I've created a landing page which currently has a login and sign up form. Both of theses work fine independently as I wanted them to. Anyway.
I’m now experiencing difficulty with the top menu. Idea been:-
1. If a user is just visiting, then display a Join Us button and a Sign In button.
2. If a user is already signed in, and they return to the landing page, then display a Dashboard Button and Sign Out button.
I’ve created this using php, however when I load the landing page I’m getting the php code been displayed as well as the buttons, instead of the buttons only.
Or would there be a better way of creating the menu, or create both of the menu in html, and getting the php code to load whichever menu is required?
Thank You very much.
I’d just like to please, enquire if php coding has been changed which is stopping my menu from displaying properly?
I've created a landing page which currently has a login and sign up form. Both of theses work fine independently as I wanted them to. Anyway.
I’m now experiencing difficulty with the top menu. Idea been:-
1. If a user is just visiting, then display a Join Us button and a Sign In button.
2. If a user is already signed in, and they return to the landing page, then display a Dashboard Button and Sign Out button.
I’ve created this using php, however when I load the landing page I’m getting the php code been displayed as well as the buttons, instead of the buttons only.
Code:
<?
if(session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
//Navigation
if ($_SESSION['member_id' != "") {
echo "<nav class='navbar navbar-light bg-light static-top'>";
echo "<div class='container'>";
echo "<a class='navbar-brand' href='/welcome.php'>". $_SESSION['settings_title'] . "</a>";
echo "<a class='btn btn-primary' href='/Members/user/dashboard.php'>Dashboard</a>";
echo "<a class='btn btn-info' href='/Guest/signin/test.php'>Test</a>";
echo "</div>";
echo "</nav>";
} else {
echo "<nav class='navbar navbar-light bg-light static-top'>";
echo "<div class='container'>";
echo "<a class='navbar-brand' href='/welcome.php'>". $_SESSION['settings_title'] . "</a>";
echo "<a class='btn btn-primary' href='/Members/user/dashboard.php'>Sign In</a>";
echo "<a class='btn btn-info' href='/Guest/signin/test.php'>Test</a>";
echo "</div>";
echo "</nav>";
}
?>
Or would there be a better way of creating the menu, or create both of the menu in html, and getting the php code to load whichever menu is required?
Thank You very much.