0 Users appreciate this thread.
How to Program Moderators?
angelrulez7 (2013-08-06 19:12:15)Create a row in your users table "mod" with default "no" and varchar(3)
Change the row of the mods you want to "yes"
And for mod functions:
<?php if($row['mod'] == 'yes'
echo "You are a mod";
}else{
echo "You are not a mod";
} ?>
a
PLMasterSSB (2013-08-07 04:00:10)@angelrulez7 it's not working. Even if I put yes in the "mod" row it just still echoes what I set it to say if your not moderator:
Anyway to fix that?
2013-08-07 11:00:51
^ Click
(This Image was created from cooltext.com)
PLMasterSSB (2013-08-07 05:30:53)I actually memorized the code, but in: $row['userlevel'], you have to change $row something? If yes, then what?
^ Click
(This Image was created from cooltext.com)
(Capt.)Orb (2013-08-08 19:42:31)You need to select data from your users table then do a while loop.
Also, try reading Akise's post again.
Aviation fact: The a380 is the largest commerical aircraft in service!
Go to Splashiverse! Splashiverse
Go to Splashiverse! Splashiverse
PLMasterSSB (2013-08-09 05:02:30)How does a while loop involve this?
^ Click
(This Image was created from cooltext.com)
(Capt.)Orb (2013-08-09 21:32:47)To specify what $row is.....
Aviation fact: The a380 is the largest commerical aircraft in service!
Go to Splashiverse! Splashiverse
Go to Splashiverse! Splashiverse
PLMasterSSB (2013-08-09 22:56:54)Yeah I found out like 2 minutes later
^ Click
(This Image was created from cooltext.com)
PLMasterSSB (2013-08-10 14:05:45)Man, it's still not working. It keeps saying I'm a normal user
^ Click
(This Image was created from cooltext.com)
11Drago (2013-08-10 16:28:04)Source Code
<?php Session_start(); Include'connect.php'; $session=htmlentities($_SESSION['username']; $sql=$con->prepare("SELECT * FROM users WHERE username=
ession"
;
$sql->bindParam("
ession",$session);
$sql->execute();
While($row=$sql->fetch()){
If($row['rank']=="Mod"
{
Echo 'You are a mod!';}
Else{
Echo 'You are a user!';}
}}
?>
<?php Session_start(); Include'connect.php'; $session=htmlentities($_SESSION['username']; $sql=$con->prepare("SELECT * FROM users WHERE username=
That's like the easiest thing you could do.
2013-08-10 23:29:17
11Drago (2013-08-10 16:30:23)Once you set up the table correctly and the connect file, that code should work.
PLMasterSSB (2013-08-10 21:39:25)I got it to work now. I did a while statement
2013-08-11 04:39:57
^ Click
(This Image was created from cooltext.com)
PLMasterSSB (2013-08-11 05:43:30)Closed
^ Click
(This Image was created from cooltext.com)
This topic is closed, so you can not post a comment.
Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)
New registered users today: 7
Newest registered user: ElegantVulpes
Sup Guys,
I need to know how to program moderator privileges and give the privileges to people.
2013-08-07 01:03:09
^ Click
(This Image was created from cooltext.com)