Grater than script needed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Grater than script needed

    Hello all good day.

    I am working on my new project atm, and it requires that registerd users will have rank status, 0 , 1 , 2 , 3 , 4 4=SUPER ADMIN

    ok i need so that anyone less than rank 3 can use the registration form.

    I cant provode my code as my www is on local host and im away from that pc atm.

    so in a nut shell

    SELECT rank from users where name = SESSION_['user']

    IF rank = < 3

    die (you dont have privlage)

    Hope you guys can help

    g-

    #2
    PHP Code:
    <?php //1st connect to data base.,and do diz.. 
    
    $id=$_SESSION['id']; 
    
    //two or more users may hav same name, so use id instead of name
    
    $query="select 'rank' from 'users' where 'id'='$id'";
     $res=mysql_query($query); 
    $lvl=mysql_fetch_array($res); 
    if($lvl<3)
     {
     echo "No previlige"; 
    } 
    else 
    {
     //rest of ur code here }
     ?>
    Last edited by Ajayme; 13.03.14, 13:35.

    Comment


      #3
      Originally posted by Ajayme View Post
      PHP Code:
      <?php //1st connect to data base.,and do diz.. 
      
      $id=$_SESSION['id']; 
      
      //two or more users may hav same name, so use id instead of name
      
      $query="select 'rank' from 'users' where 'id'='$id'";
       $res=mysql_query($query); 
      $lvl=mysql_fetch_array($res); 
      if($lvl<3)
       {
       echo "No previlige"; 
      } 
      else 
      {
       //rest of ur code here }
       ?>
      Brill thats what i needed thanks alot

      g-

      Comment

      Working...
      X