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 7930719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:30:51+00:00 2026-06-03T20:30:51+00:00

I have a question about header(‘location: —-.php’) . Is it safe for an ADMIN

  • 0

I have a question about header('location: ----.php'). Is it safe for an ADMIN to use this function to restrict USER access for some pages? For example if a user is not an ADMIN can I use this function to prevent the user from seeing some pages? Is this a good way to secure some pages from unauthorized access? If not can someone give me a suggestion for secure restriction?

For example I’m using this for restriction:

$id = $_SESSION['id'];
$queryget = mysql_query("SELECT * FROM users WHERE id='$id'"); 
$row_12 = mysql_fetch_assoc($queryget);
$admin = $row_12['admin_id'];
$ruka = $row_12['rukovoditelj'];


if($row_12['admin_id'] > 1)
{
    header('Location: dosjei.php');
}
  • 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-03T20:30:52+00:00Added an answer on June 3, 2026 at 8:30 pm

    It’s safe assuming you stop the execution of the script after (with the exit; order for instance).

    header("Location: dosjei.php");
    exit;
    

    Of course you need to do the verification at the beginning of the script before to write on the page some data you need to hide to unauthorized users.

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

Sidebar

Related Questions

I have a question about PHP's fopen() function (using php://output). Server A uses this
I have a question about PHP require() function. I have a PHP script called
I have some question about header files(I'm talking about c, but I think it
Hi I have a question about the ISA header structure of EDI X12 message:
I have asked this question here about a Python command that fetches a URL
NB This is not a question about how to use inline functions or how
I have a question about the relationship between header and implementation files in C++.
I have a question about source file and header in c++. I have a
I have a question about the images displaying using a function getImage_w($image,$dst_w), which takes
=) I have a question about undefined reference to in C++. Here in this

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.