Hello everyone,
I really really need some help with this as Ive been trying to sort since December and cannot seem to get past it. I only know very basic PHP and still currently learning.
Basically I have a website with multiple pages and a membership system which has a ranking system for my members. The access to a page is set by the $rank_check = 5; statement which allows access to that particular rank and above. If I use the $rank_check == 5; then this will make access to that page ONLY for that rank which is great.
However, I currently have ranks between 1-99 and really need to be able to set the page access to allow which ever ranks I state otherwise admin could be accessed by unauthorised members.
So for example, if I want page 1 to have access to every rank above 5 then I can set it as: $rank_check = 5;
If I want page 2 to have access to ONLY rank 67 then I can use the $rank_check == 67; which is fine.
However, how do I set it so that I can set page 3 to allow access to for multiple ranks .... example ... ranks 5, 7, 48,67 and 99????
I have tried using the If statements. Also tried using the && statements along with the $rank_check == 5; but it didnt work. :O(
PLEASE PLEASE PLEASE help me and I will be eternally grateful. lol
Here is the actual document code:
<?php
/*
Admin Main (admin.php)
*/
$page_title = "Admin - Founder Highly Restricted";
$rank_check = 5;
include "../header.inc.php";
print "$openHTML";
ECHO <<<END
PAGE CONTENT HERE
END;
print "$closeHTML";
?>
Here are some attempts at what I have tried using so far:
if($rank_check == 6 || $rank_check == 7 || $rank_check == 8){ include "../header.inc.php";
$page_title = "admin_access6.php";
$rank_check == 6 || $rank_check == 7 || $rank_check == 8;
if($rank_check == "6" || $rank_check == "7" || $rank_check == "8"){ $let_them_pass = true;}
if($set_rank == 6 || $set_rank == 7 || $set_rank == 8){ $let_them_pass = true;}
<?php $page_title = "admin_access6.php";if($rank_check != 6 && $rank_check != 7 && $rank_check != 8){ exit;}include "../header.inc.php"; print "$openHTML"; $credit = $getGame[credit] / 100; ECHO <<<END
None of these seemed to work.
Hope someone can help me as this is a really big and urgent job I need on my website.
Thanks you so much
Justin :o)