FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP + .htaccess





Diablosblizz
Alright, this might be a long post, and I don't know if this is even possible. Heres what I want to do:

I want to fopen a folder, which is password protected by .htaccess. Now, when I try to open the folder, I get this message:

Code:
Warning: fopen(http://myip/forbidden/database/vouchers) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in /home/diablosb/domains/hotelmario.info/public_html/members/shop.php on line 25


I think what that means, is that when the server is trying to open the folder, it is being asked to enter the username and password, which is not poping up.

The reason I am password protecting it is because there is important files there, they NEED to be there.

My question is:

How do I get php to open the folder using the username and password I put in the .htaccess.

I really hope that this is possible and compatible with fopen.

Thanks!!
Stubru Freak
Not sure, but try using:
Code:
http://USERNAME:PASSWORD@ip/path

for the URL.
Diablosblizz
Didn't work. Anybody else, I seriously need this to work.
vinx_18
It might be the permissions.... change the permission by using CHMOD...Smile
Diablosblizz
What the file thats trying to connect, or the folder. I am not sure if I can CHMOD them from Xampp directory, if not ill use FTP.

What file?
Diablosblizz
Sorry double post but:

I fixed it, just changed the deny and allow permissions. You can close this now.
Related topics
Must cpanel be 2082? I can't connect
.htaccess issues with & and ? characters in title
301 Redirect
[tutor] How to protect images without htaccess using PHP
Limiting php file functions with .htaccess
301 redirection in PHP and .htaccess
htaccess Password Protection
CANT UPLOAD .htaccess, .htpasswd, .header, .footer
How To : Secure Your PHP Website
.htaccess
[PhP] News Posting Tutorial (code, actually ^^')
[SOLVED] PHP is not working
.htaccess problem
Cron jobs - running a php file
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.