starvator Posted April 6, 2010 Share Posted April 6, 2010 Hi, I have a little problem <? if($session->logged_in){ echo "Welcome <b>$session->username</b>!" ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] " ."[<a href=\"useredit.php\">Edit Account</a>] "; if($session->isAdmin()){ echo "[<a href=\"admin/admin.php\">Admin Center</a>] "; } echo "[<a href=\"process.php\">Logout</a>]"; } ?> I want to change the links into a navigational menu <div id="menu-container"> <ul id="navigationMenu"> <li><a href="#" class="normalMenu">My Account</a></li> <li><a href="#" class="normalMenu">Edit Account</a></li> <li><a href="#" class="normalMenu">Admin Center</a></li> <li><a href="#" class="normalMenu">Logout</a></li> </div> Is there a way to put a div inside a echo? Thanks! Link to comment https://forums.phpfreaks.com/topic/197704-div-inside-an-echo/ Share on other sites More sharing options...
doddsey_65 Posted April 6, 2010 Share Posted April 6, 2010 you mean: echo '<div id="menu-container">'; Link to comment https://forums.phpfreaks.com/topic/197704-div-inside-an-echo/#findComment-1037561 Share on other sites More sharing options...
starvator Posted April 6, 2010 Author Share Posted April 6, 2010 you mean: echo '<div id="menu-container">'; I do not understand what you mean... <? if($session->logged_in){ echo "Welcome <b>$session->username</b>!"; echo '<div id="menu-container"> <ul id="navigationMenu"> <li><a href="userinfo.php?user=$session->username\" class="normalMenu">My Account</a></li> <li><a href="\"useredit.php" class="normalMenu">Edit Account</a></li> <li><a href="#" class="normalMenu">Admin Center</a></li> <li><a href="process.php\" class="normalMenu">Logout</a></li> </div>' if($session->isAdmin()){ echo "[<a href=\"admin/admin.php\">Admin Center</a>] "; } echo "[<a href=\"process.php\">Logout</a>]"; } ?> I am REALLY confused... Link to comment https://forums.phpfreaks.com/topic/197704-div-inside-an-echo/#findComment-1037563 Share on other sites More sharing options...
doddsey_65 Posted April 11, 2010 Share Posted April 11, 2010 you need to put a ; at the end of your </div> </div>'; Link to comment https://forums.phpfreaks.com/topic/197704-div-inside-an-echo/#findComment-1040138 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.