Echo PHP
Posted: Fri Nov 23, 2012 9:45 pm
SO on my site I have a navigation bar.
yourtechview.com
Now in the past I've had to manually change every single freaking link in the navigation bar on ALL 40 plus pages of my site.
As you can tell this becomes a very very strenuous process. I am now trying to store all of the navigation bar information inside a file called menu.php
I stored all of the html for the navigation bar into a variable called $nav1 . $nav1 is shown to users that are not logged in.
I stored all of the html for the navigation bar to be seen by a user that is logged into into $nav2.
When you login to my site; the tab that says "Login" changes to the username of your account.
The problem is that I keep getting a blank space. $myusername is defined as the session username on both menu.php and my index test page. I basically want to echo a variable that contains php inside of it.
yourtechview.com
Now in the past I've had to manually change every single freaking link in the navigation bar on ALL 40 plus pages of my site.
As you can tell this becomes a very very strenuous process. I am now trying to store all of the navigation bar information inside a file called menu.php
I stored all of the html for the navigation bar into a variable called $nav1 . $nav1 is shown to users that are not logged in.
I stored all of the html for the navigation bar to be seen by a user that is logged into into $nav2.
$nav2 =' <li> <a href="/index.php">Home</a> <ul> <li> <a href="/home.php">Special Home Page</a> </li> </ul> </li> <li> <a href="/forum.php">Forums</a> <ul> <li style="z-index:5;"> <a href="/forum_section.php?sid=17">New Members</a> </li> <li style="z-index:5;"> <a href="/forum_section.php?sid=19">General Chat</a> </li> <li> <a href="/forum_section.php?sid=38">Announcements</a> </li> </ul> </li> <li> <a href="/lounge.php">Lounge</a> <ul> <li style="z-index:5;"> <a href="/photoroll.php">Memes & Rage Comics</a> </li> <li style="z-index:5;"> <a href="/lounge.php">Video Blog</a> </li> <li> <a href="#">Games (coming soon)</a> </li> <li> <a href="#">Contests (coming soon)</a> </li> </ul> </li> <li> <a href="/articles.php">Articles</a> </li> <li> <a href="/market.php">Market</a> <ul> <li style="z-index:5;"> <a href="/market.php">Redeem Points</a> </li> <li style="z-index:5;"> <a href="http://myworld.ebay.com/yourtechview/">YTV Store</a> </li> <li> <a href="/forum_section.php?sid=22">Sell Your Stuff</a> </li> </ul> </li> <li> <a href="/source/login.php">Login</a> <ul><li><a href="/source/register.php">Register</a> </ul> </li> </li>';Here's the flow of the problem.
When you login to my site; the tab that says "Login" changes to the username of your account.
The problem is that I keep getting a blank space. $myusername is defined as the session username on both menu.php and my index test page. I basically want to echo a variable that contains php inside of it.