Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP easier way to hide/show menu items to logged in / logged out users
    primarykey
    data
    text
    <p>Is there an easier more efficient way to hide/show menu items to logged in, logged out users? It seems like I should not have to copy the whole menu again with duplicate menu items. The menu items maybe in different order like below</p> <p>You can see in my example below I have added to links in the <code>&lt;?php } else { ?&gt;</code> statement</p> <pre><code>&lt;?php if($_SESSION["loggedIn"] == "yes") { ?&gt; &lt;ul class="nav navbar-nav"&gt; &lt;li class="active"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="retailers.php"&gt;Stores&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="coupons.php"&gt;Coupons&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="featured.php"&gt;Featured Offers&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="howitworks.php"&gt;How It Works&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="help.php"&gt;Help&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;?php } else { ?&gt; &lt;ul class="nav navbar-nav"&gt; &lt;li class="active"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="retailers.php"&gt;Stores&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="coupons.php"&gt;Coupons&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="myaccount.php"&gt;My Account&lt;/a&gt;&lt;/li&gt;//logged in item &lt;li&gt;&lt;a href="featured.php"&gt;Featured Offers&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="howitworks.php"&gt;How It Works&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="help.php"&gt;Help&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="myfavorites.php"&gt;My Favorite Stores&lt;/a&gt;&lt;/li&gt;//logged in item &lt;/ul&gt; &lt;?php } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload