Re: crypt() problems

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&...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-15-2003
s a n j a y
 
Posts: n/a
Default Re: crypt() problems

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
>
>



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:03 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0