Jump to content

Menu selection based on current pages


Lassie

Recommended Posts

I want to show a secondary menu based on a user logging in and the current page he is on.

I have a seession id to test fro and a check whether the current page is a page that should not display the secondary menu.

The problem is it doesnt work for mutiple pages and seems a long way of going about it. The pages that I dont want the secondary menu to show on are all in a seprerate directory ./reg/xxx.php  Is there a better way?



<?php
// Display links based upon the login status.
			// Show LOGIN links if this is the LOGOUT page.
				if (isset($_SESSION['user_id']) AND (substr($_SERVER['PHP_SELF'], -10) != 'logout.php')AND(substr($_SERVER['PHP_SELF'], -10) != 'register.php')AND(substr($_SERVER['PHP_SELF'], -10) != 'index.php')AND(substr($_SERVER['PHP_SELF'], -10) != 'forgot_password.php')AND(substr($_SERVER['PHP_SELF'], -10) != 'view_account2.php')) )
				{
					?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.