Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

alter htaccess with php

Status
Not open for further replies.

jennyflower

Programmer
Oct 10, 2006
60
GB
Hi,

I want to create a site that allows users to have access to their directory which stores some files for them.

I want to be able to add a user, create their directory then alter the htaccess file to password protect the directory. Is there anyway to do this with php as I am just trying to avoid having to go into my hosting control panel everytime I add a new user in.

I don't really yet understand completely how htaccess and htpassword work yet though so a really simplified version of what to do along with a description of what each ht file actually does would help!

Thanks
 
provided you have write access to your web directories (from php) you can create htaccess and htpassword files on the fly. use a combination of fopen and fwrite.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top