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?
Change Left side menu according to user type
Collapse
X
-
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
Code:<?php $varAccess = 1; switch ($varAccess) { case 1: echo "Link 1"; echo "Link 2"; echo "Link 3"; echo "Link 4"; break; case 2: echo "Link 1"; echo "Link 2"; echo "Link 4"; break; case 3: echo "Link 1"; break; default: echo "Please Login"; } ?> -
Since you do not show any code, I'll guess.
[php]
if ($user_authoriz ation == 9) { // admin
echo '<a hef="admin_menu .php">Link 1</a>';
}
elseif ($user_authoriz ation == 1) { // special user
echo '<a hef="special menu.php">Link 2</a>';
}
else {
echo '<a hef="normal_men u.php">Link 3</a>'; // normal user
}
[/php]
If you do not show the code, that's all I can show you.
RonaldComment
-
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.
RonaldComment
-
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...
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 qualityComment
-
Thank you harshmaul. You flatter me.Originally posted by harshmaulHi,
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...
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
RonaldComment
Comment