Admin folder Validation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
phpcoder
Forum Contributor
Posts: 158
Joined: Sat Nov 02, 2002 1:18 pm
Location: Manchester, UK

Admin folder Validation

Post by phpcoder »

Hi,

I got a admin folder on my website. I want to put security on that folder so when ever some one try to acces that folder :

http://www.myweb.com/admin

Then it should come up with dialog boz asking for user name and password. Please let me know how to do it. My web server is linux fedora.

Thanks
User avatar
Josh1billion
Forum Contributor
Posts: 316
Joined: Tue Sep 11, 2007 3:25 pm

Post by Josh1billion »

I'm not sure how you'd go about it with your setup, but my webhost (like many webhosts) uses CPanel which has a menu item called "Password-Protect Directories." If you have CPanel, you can go there and password protect them from there.
User avatar
phpcoder
Forum Contributor
Posts: 158
Joined: Sat Nov 02, 2002 1:18 pm
Location: Manchester, UK

Post by phpcoder »

Josh1billion wrote:I'm not sure how you'd go about it with your setup, but my webhost (like many webhosts) uses CPanel which has a menu item called "Password-Protect Directories." If you have CPanel, you can go there and password protect them from there.
I have not got any gui interface to my webserver I need to setup everythig manually in text mode.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

PHP can return Basic HTTP Authentication headers which will request a username and password (like you are asking about). Look in the documentation for header().
Post Reply