PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, October 19, 2022

[FIXED] how to restrict access to admin folder except logged user

 October 19, 2022     admin, php, restrict     No comments   

Issue

I have folder /admin/index.php how to restrict access to that folder except logged user. I try to restrict access with .htaccess but it restrict access at all


Solution

On your /admin/index.php are you checking these things:

  1. Is the user logged in? - If not, redirect them to the login page.
  2. Is the logged in user an Admin? - If not, redirect them to another page.

Seems like the logical way to tackle this.



Answered By - l0gic
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing