Jump to content

[SOLVED] small problem


LOUDMOUTH

Recommended Posts

I want to make this code so admin 1 and admin 2 can view this area.

right now it is set to only display for admin 2 category. 

 

Can someone help me make it so that admin 1 and 2 can view it but not admin 0.

 

if ($user_class->admin != 2) {
  echo Message("You are not authorized to be here. YOU MOTHERFUCKER");
  include 'footer.php';
  die();
}

 

I can provide more info if needed, thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/168280-solved-small-problem/
Share on other sites

<?php

if($user_class > 2){
echo Message("You are not authorized to be here. YOU MOTHERFUCKER");
  include 'footer.php';
  die();
}

 

or

<?php
if($user_class < 1){
echo Message("You are not authorized to be here. YOU MOTHERFUCKER");
  include 'footer.php';
  die();

 

depending on the number of the class of a normal user is

Link to comment
https://forums.phpfreaks.com/topic/168280-solved-small-problem/#findComment-887596
Share on other sites

 

Thanks guys  I have too many categories of staff to use the  > or < dadamssg.

 

This works perfect though, thank you both, dadamssg. and rhodesa!

 

if ($user_class->admin != 1 && $user_class->admin != 2) {
  echo Message("You are not authorized to be here. YOU MOTHERFUCKER");
  include 'footer.php';
  die();
}

Link to comment
https://forums.phpfreaks.com/topic/168280-solved-small-problem/#findComment-887602
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.