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

  • SEARCH
  • Home
  • 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 698249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:15:15+00:00 2026-05-14T03:15:15+00:00

Hey guys I have an admin page that checks if you are admin before

  • 0

Hey guys I have an admin page that checks if you are admin before submitting any queries, and contains a header to the index page if you are not admin, but I am worried about protecting the page. I am concerned someone may be able to destroy my database with it. Does anyone have any recommendation into protecting a page like this, if not, should I just manually admin my database through phpmyadmin and delete the page all together?

Example

function isAdmin(){
      return ($this->userlevel == ADMIN_LEVEL ||
              $this->username  == ADMIN_NAME);
   }

 if(!$session->isAdmin()){
         header("Location: ../index.php");
         return;
      }

The admin value is stored in the database and represents ADMIN_LEVEL

  • 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-05-14T03:15:16+00:00Added an answer on May 14, 2026 at 3:15 am

    It’s rather common for websites to have an administrators section, but you do have to make sure, on every page, before anything is inserted, removed, etc. that the user is an admin, something you are doing.

    However, having a page that lets you enter explicit SQL statements and executes them probably isn’t a good idea. You could too easily enter something wrong, and it does leave a MUCH larger security hole, should something go wrong. Larger as in, easier to access system admin-level commands, depending on the setup.

    Not to mention the ease of messing something up yourself.

    Direct SQL queries is why you have phpMyAdmin. Admin sections are normally intended to be a GUI frontend of your data, just as the website for regular users is, but with a greater range of abilities. Such things as being able to list all users, edit a user’s data through a controlled form, then updating or deleting them with a button.

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

Sidebar

Related Questions

Hey guys, I have a little button functionality that is not erring, but also
Hey guys, I have a regular expression that is pretty long, and is hard
Hey guys i have a ListActivity... a very simple at that... and it keeps
Hey guys I have one more question lol. I am using a script that
Hey guys, I have a question about Sphinx. I use Sphinx to index the
Hey guys I have a question. I wanna create a profile page for each
Hey guys, So I have this report that I am grouping into different age
hey guys i have a restful xml service where client passes current version of
Hey guys I have a gridview and below it 4 textboxes I'm using to
Hey Guys I have the following simple Code : WhereAmIViewController.h #import <UIKit/UIKit.h> #import <CoreLocation/CoreLocation.h>

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.