473,396 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Change Left side menu according to user type

250 100+
In my application there are 3 user types and after thy logging i want to display different link according to the user type. (Eg: I want to hide some links from the normal user that are accessible only for administrators.) How can i do that?
Feb 15 '08 #1
6 1733
harshmaul
490 Expert 256MB
Hi,
If you have the users access writes available, you could stick them all in embeded if statements, or using a switch.


I included a switch, it does need to be bult upon tho

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $varAccess = 1;
  3.  
  4. switch ($varAccess)
  5. {
  6. case 1:
  7.   echo "Link 1";
  8.   echo "Link 2";
  9.   echo "Link 3";
  10.   echo "Link 4";
  11.   break;
  12. case 2:
  13.   echo "Link 1";
  14.   echo "Link 2";
  15.   echo "Link 4";
  16.   break;
  17. case 3:
  18.   echo "Link 1";
  19.   break;
  20. default:
  21.   echo "Please Login";
  22. }
  23. ?>
Feb 15 '08 #2
ronverdonk
4,258 Expert 4TB
Since you do not show any code, I'll guess.
[php]
if ($user_authorization == 9) { // admin
echo '<a hef="admin_menu.php">Link 1</a>';
}
elseif ($user_authorization == 1) { // special user
echo '<a hef="special menu.php">Link 2</a>';
}
else {
echo '<a hef="normal_menu.php">Link 3</a>'; // normal user
}
[/php]
If you do not show the code, that's all I can show you.

Ronald
Feb 15 '08 #3
ghjk
250 100+
Still confusing. May i need to use sessions?
Feb 16 '08 #4
ronverdonk
4,258 Expert 4TB
For what would you want to use sessions? To store user data? Since we still see no code, I am afraid that is all I can tell you.

Ronald
Feb 16 '08 #5
harshmaul
490 Expert 256MB
Hi,
I have to agree qith ronver, we can only suggest ideas, we can't solve your problem without some code that you have written.

Please post the code you have made?

If you haven't made anything yet please start now...

http://www.codersadvocate.com/blogs/...sposition_PHP/

This link will get you started, And if you ask ronver nicely he might be able to find you a thread of an admin login thing he did which is top quality
Feb 16 '08 #6
ronverdonk
4,258 Expert 4TB
Hi,
I have to agree qith ronver, we can only suggest ideas, we can't solve your problem without some code that you have written.

Please post the code you have made?

If you haven't made anything yet please start now...

http://www.codersadvocate.com/blogs/...sposition_PHP/

This link will get you started, And if you ask ronver nicely he might be able to find you a thread of an admin login thing he did which is top quality
Thank you harshmaul. You flatter me.

Ronald
Feb 16 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Doug McCrae | last post by:
http://www.btinternet.com/~doug.mccrae/go4learning/index.html As it says in the subject, a two column layout (plus header and footer boxes). I feel the left column really needs to be fixed width...
10
by: Richard | last post by:
The style sheet shown below is from the suckerfish vertical menu. http://www.htmldog.com/articles/suckerfish/dropdowns/example/vertical.html I've added in a few minor changes to color code the...
2
by: RWD | last post by:
I am trying to figure out how to change the target frame in my hyperlink on a DHTML menu. The menu is in one frame and the target frame is called "main" The code is below: Thanks in advance...
2
by: Tony Meier | last post by:
I am using the WebBrowser control (Explorer.Shell.2) from within a VBA application, embedded on an MS Access form to display the contents of a local folder. By default on Windows 2000/XP the...
3
by: Ohad Young | last post by:
Hi, I have a frameset page that contains two frames: 1. the first frame, an aspx page, contains a menu for navigating in the website. 2. the second frame contains content, pdf, html or other...
10
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio...
0
by: Gary Wessle | last post by:
Hi The program I am trying to make is a basic one, it provides a command line menu to the user and accepts the choice given by the user selection from the main menu. it then spawns a new thread...
3
by: MLD | last post by:
PLEASE HELP! I would like to include a UL as a menu, styled by an included CSS Style Sheet. The problem I am having is how do I dynamically set the "active" page class using JavaScript to...
6
by: happyse27 | last post by:
Hi All, How do I change the height of the main menu as the height is inconsistent due to some of main menu's item stretches to 2 rows while, the other main menu's items are stretched to 1 row. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.