Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8228039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:20:08+00:00 2026-06-07T16:20:08+00:00

In my members database I have a section called rank. Basically what im trying

  • 0

In my members database I have a section called rank.

Basically what im trying to do is make certain pages viewable to members with a rank higher than 12 for example, and if the rank is lower than 12 then they are redirected back to the home page. (obviously their will be lots of different pages for rank 5+ members, Rank 7+ members, rank 20+ members etc)

Can anyone help me with a tutorial or something please?

I did ask for help earlier with my current code, but I dont think that code is ever going to work, Ive been changing it and playing with it for a week now and can not possibly see any other ways to get it to work Members Rank only area's

I am still learning php, So ideally a nice easy explaining tutorial would be nice.

Database:

id int(11) 
username varchar(200) latin1_swedish_ci 
password varchar(216) latin1_swedish_ci 
security varchar(200) latin1_swedish_ci 
email varchar(216) latin1_swedish_ci 
ip varchar(200) latin1_swedish_ci 
rank varchar(216) latin1_swedish_ci 
name varchar(30) latin1_swedish_ci 
age varchar(40) latin1_swedish_ci 
gender varchar(40) latin1_swedish_ci 
location varchar(40) latin1_swedish_ci 
helpfaerie int(11) 
profile text latin1_swedish_ci 
about text latin1_swedish_ci 
tasks text latin1_swedish_ci 
joined varchar(216) latin1_swedish_ci 
laston int(200) 
icedmutereason text latin1_swedish_ci 
icedmutedetails text latin1_swedish_ci 
icedmuteby varchar(200) latin1_swedish_ci 
icedmutedate int(200) 
posts int(11) 
signature varchar(216) latin1_swedish_ci 
avatar varchar(216) latin1_swedish_ci 
neohtml text latin1_swedish_ci 
siggy text latin1_swedish_ci 
verify int(11) 
changedpass int(1)

Header.inc.php

<?php 

include ($_SERVER['DOCUMENT_ROOT'].'/dblink.php'); 
include ($_SERVER['DOCUMENT_ROOT'].'/addon.php'); 

$geterror= $_GET['error'];

$error= stripplus($geterror);

$extra = mysql_fetch_array(mysql_query("SELECT * FROM extra WHERE id='1'"));


$cp = mysql_fetch_array(mysql_query("SELECT * FROM members WHERE username = '$username'"));



$weather = $extra[weather];
$wurl = $extra[wurl];
$games = $extra[games];
$xword = $extra[xword];
$xword2 = $extra[xword2];
$xworddate = date("M j Y",$extra[xworddate]); 
$userinfo = mysql_fetch_array(mysql_query("SELECT * FROM members WHERE username='$username'"));
$rank = $userinfo[rank];




if (!$checkrank) { $checkrank = 0; }
if (!$rank) { $rank = 0; }
if (!$rank == ' ') { $rank = 0; }
if ($rank < $checkrank)
{

     header("Location: $baseurl/index.php?error=You+can+not+view+this+page.");
}




if ($rank >= 30)
{

    $admin = "<a href=\"$baseurl/staff/admin.php\">Admin</a>";
}


if ($username)
{

mysql_query("UPDATE members SET laston = $timestamp+120 WHERE username='$username'");

mysql_query("UPDATE members SET ip = '$ip' WHERE username='$username'");

    $login = "Welcome $username :) <a href=\"$baseurl/logout.php\" >Logout</a>";

$helpfaerie = "<a href=\"$baseurl/helpfaerie.php\" >Help Faerie</a>";

}

else
{
$login = "<form name=\"login\" action=\"$baseurl/login.pro.php\" method=\"post\"  > <input type=\"hidden\" name=\"act\" value=\"doLogin\" color=\"#000000\" valign=\"middle\" >&nbsp;Username: <input type=\"text\" name=\"username\" color=\"#000000\"  style=\"width:100px; height:20px;font-size:10px;\">
Password: <input type=\"password\" name=\"password\"  style=\"width:100px; height:20px;font-size:10px;\"> <input type=\"submit\" name=\"submit\" value=\"Login\" style=\"width:42px; height:20px;font-size:10px;\"></form>";


}


ECHO <<<END

and then the font.php

<?php
$pagetitle = "Add Font";





session_start();

// Rank Limit
       $limit = 10;

        // Using a session 
    $rank = $_SESSION['rank'];

       // Using a cookie
       $rank = $_COOKIE['rank'];

    if ($rank < $limit) {
        header("$baseurl/index.php?error=You+can+not+view+this+page.");
        exit();
        die();
    }


include ($_SERVER['DOCUMENT_ROOT'].'/staff/header.inc.php');


ECHO <<<END
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:20:10+00:00Added an answer on June 7, 2026 at 4:20 pm

    What you are looking for is an ACL (access control list) probably combined with authentication. An ACL will allow you to specify which resources a user with specific credentials has access to.

    I have located a few tutorials, but this is not for the faint of heart.

    • http://phpmaster.com/role-based-access-control-in-php/
    • http://blog.davidjclarke.co.uk/database-driven-zend-acl-tutorial-part-one.html
    • http://www.developer.com/lang/php/creating-a-custom-acl-in-php.html

    and maybe you could use a class from phpclasses to get you started:

    PHPClasses ACL search result

    Also as far as I know all of the popular frameworks have ACL and Authentication resources. (Zend Framework, Symfony, CakePHP).

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a members only section on a website. The user
I have a database table called ' members '. Assigned to members is a
I have five tables in my database. Members, items, comments, votes and countries. I
I have created a simple members database in ASP.NET with login and create account
I have a database where people might simultaneously be employees, customers and members of
I have two tables in my database members (member_id, firstname, lastname) members_photos (member_id, photo_id)
I have been trying to make a user login page that, when the user
Right now in a database I have a Members table and a Products table
I have a table called members. I am looking on advice how to improve
So I have a fairly large database of ~800,000 members I want to run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.