Hi,

I have a web site.

On index.php I have a HTML link to admin/admincp.php

By simply adding a htaccess file to the directory 'admin', will the admin directory and it's contents be fully protected?

I only want it to be possible for me to access mysite.com/admin/admincp.php, because I am the administrator and will be adding records to a mysql database through a HTML form in it.

Recommended Answers

All 3 Replies

I don't really think so. Maybe, if you have it check if the person is an admin on every page, and if they aren't, use 'header' to redirect to another page, that would work. I don't think that htaccess makes a difference, but I might not be right.

commented: Thanks man. +1

Why not You Chose the Login System in Your Site Admin Panel because this Make Your Admin Panel More Secure and Only You are Access Your admincp.php page not anyone.

commented: Thanks man +1

Thanks for the responses.

From my understanding, as I long as I am located within the protected directory structure, and I use an SSL connection for remote login, I am good to go.

I will not be adding any code for cookies or sessions. I don't know if .htaccess creates any, but I don't plan to.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.