PHP Security

How would one go about protecting a folder on a webserver using PHP? I'm not able to use .htaccess for some reason on the servers I use for hosting my website. I'm using's package and that seems to not let me use .htaccess. Maybe I'm using it wrongly or something. But is this a fact, that GoDaddy doesn't accept .htaccess?

Anyway, I'd like to be able to have a simple login screen where poeple login with a username/password and it gives them access to the folder+links in the folder that has pages in it (and all it's subfolders). Also, it shouldn't let people surf directly to a link in the folder (eg.

Can anyone help me with this problem?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TomeeboyCommented: supports htaccess files as far as I know... Their help section even talks about them:
GamzarmeAuthor Commented:
Thanks, got it working..kinda.
It works on any other file besides regular .php files. Not sure why though.
Any workaround for this?

Also, can you integrate the login box into a webpage php file?
As far as I know, the only way to accomplish that kind of integration would be to have PHP read and interact with the .htaccess file.  By the time you were done with it, you might as well have just made a simple login script (or used an existing one).

As for the .php file problem, I'll have to look into that a bit.  I never really use htaccess for anything, so I'm unfamiliar with that problem.  It could have something to do with PHP being parsed server side.

If you want the integration into a custom login page / form, you may just want to go with a simple authentication script that uses PHP / Sessions.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GamzarmeAuthor Commented:
What do you mean "have PHP read and interact with the .htaccess file"? How would one go about doing that?

About a script, what does one look like?
Also, sessions, new to me also.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.