Jump to content

User Levels


dean7

Recommended Posts

in my database i have user lvl in the users table witch has lvls like owner But when i change

 

<?php
if($row['level']== owner {
?>

 

It doesnt show the link to the users who have the user lvl owner

 

 

This is what im trying.

 

<?php
if($row['level'] == owner){
?>
- <a href="../admin/index.php" target="mainFrame">Admin</a><br>
<?php
}
?>

 

but that dont show the link after

Link to comment
https://forums.phpfreaks.com/topic/171324-user-levels/#findComment-903511
Share on other sites

My code is now

 

<div class="menutitle" onclick="SwitchMenu('sub1')">Staff Panel</div>
<span class="submenu" id="sub1">
	<?php
var_dump($row['level'] == "owner"){ // line 132
?>
- <a href="../admin/index.php" target="mainFrame">Admin</a><br>
<?php
}
?>

 

But its now saying

Parse error: syntax error, unexpected '{' in /home/a7502957/public_html/nav.php on line 132

Link to comment
https://forums.phpfreaks.com/topic/171324-user-levels/#findComment-903531
Share on other sites

Doing that makes an error

 

Parse error: syntax error, unexpected ')', expecting ']' in /home/a7502957/public_html/nav.php on line 133

 

My code

 

<div class="menutitle" onclick="SwitchMenu('sub1')">Staff Panel</div>
<span class="submenu" id="sub1">
<?php
var_dump($row['level']);
if($row['level' == "owner"){ // line 133
?>
- <a href="../admin/index.php" target="mainFrame">Admin</a><br>
<?php
}
?>

Link to comment
https://forums.phpfreaks.com/topic/171324-user-levels/#findComment-903536
Share on other sites

Do you have a connection to the database in that code?

Do you have it connecting to the table level is in?

Do you have a level named owner?

Yeah i have a connection to the database in the code

I have the lvl called owner

But what you mean by have it connecting to the table level is in?

Link to comment
https://forums.phpfreaks.com/topic/171324-user-levels/#findComment-903544
Share on other sites

I do it while the user submits his log in data so

 

index.php - > check.php ( check.php sets all my sessions and checks the database for the proper username and password if username and password = true meaning it is correct then sends to profile.php which then if the sessions are correct for the user to have admin rights 3 being admin 2 being mod 1 being  no admin/mod rights just regular member if it is 3 then it displays admin if it is 2 it displays mod if 3 it displays nothing. pretty simple way of doing it. if I was at home or had my scp connection i would give you my script for you to use.

Link to comment
https://forums.phpfreaks.com/topic/171324-user-levels/#findComment-903550
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.