Grater than script needed

Started on the old forum in March 2014 · view the original in the archive · old links redirect here

2 replies · 221 views · started 12 years ago · 1 min read

2 participants
ares1981 Junior · 25 posts #1

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-

Ajayme Newbie · 8 posts #2
<?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 }
 ?>
ares1981 Junior · 25 posts #3

Ajayme wrote:

<?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-

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close