Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

restriction for module.

Newbie Spellweaver
Joined
Sep 10, 2005
Messages
51
Reaction score
2
Hello coders section,

Have a nice day, let me ask how to add required file for example viplist.txt <--- all vip user name inside of this file. Then i have new created page module for vip's and normal user cant use thi.s module.

Tia.
 
Pee Aitch Pee
Joined
Mar 30, 2011
Messages
630
Reaction score
422
Loop through the viplist.txt file, add each name to an array, grab the username from a session or wherever the current logged in user is stored, check if in array of viplist, grant access. Pretty disgusting to do it this way though.
 
CPP/C#/PHP/ASM
Joined
Apr 7, 2009
Messages
452
Reaction score
189
Code:
<?php //$lines = file('http://DarkMaster69.com/viplist.txt'); (you can use remote files too! ).
$vipUsers = file('viplist.txt');


foreach ($vipUsers as $uIndex => $user) {
	if(htmlspecialchars($user) == $_SESSION['Username']) {
		echo "this user $user which is at line {$uIndex} found at viplist.txt and the secret menu can be shown for him";
	}
}
?>

well , i wrote this for you .. it should work...

the thing here is , its useless.. just use database and add a calum called "userType" near the username which can be set to normal,admin,etc .

good luck .
 
Back
Top