This is a discussion on Re: crypt() problems within the alt.comp.lang.php forums, part of the PHP Programming Forums category; may be you should try this. AuthUserFile /your directory/.htpasswd AuthGroupFile /dev/null AuthName ByPassword AuthType Basic <Limit GET&...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
may be you should try this.
AuthUserFile /your directory/.htpasswd AuthGroupFile /dev/null AuthName ByPassword AuthType Basic <Limit GET> require user userName </Limit> Sanjay "Terry" <dcsnospam@ntlworld.com> wrote in message news:D_TQa.1196$0g3.29900@newsfep1-win.server.ntli.net... > Hi, > > I used this....... > > ------------------------------------------------------- > <?php > $username="thisuser"; > $password="thispw"; > $fhnd = fopen("../.htpw","a"); > $crypt_pw = crypt($password); > $newline = $username.":".$crypt_pw."\n"; > fwrite ($fhnd, $newline); > fclose($fhnd); > ?> > ------------------------------------------------------- > > to write to my ../.htpw file (password file). > > I then set up this .htaccess in the required directory...... > > ------------------------------------------------------- > DirectoryIndex index.html > > AuthUserFile ../.htpw > AuthType Basic > > <LIMIT GET POST> > require valid-user > </LIMIT> > > ------------------------------------------------------- > > Problem........ > when I try to access the directory I get the username\password prompt (as > required) but it rejects the thisuser\thispw combination. > > Any help\explanation would be most welcome ;-) > > mtia > > |
![]() |
| Thread Tools | |
| Display Modes | |
|
|