--- Marian Briones <[EMAIL PROTECTED]> wrote:
> Well I couldn't get this to work. I do not know what to do. I can't
> find anything on it except what **should** work and it does not.
>
> I tried m5, I tried crypt, and neither made a workable password that
> allowed me to then try to login as that user.
>
> I can run htpasswd from the command line and create what I need and
> guess what, it works when I go in as that username...but when I try to
> print that password through php, no can do.
>
> Does anyone have anything they have used to do this that I could at
> least **try?**
>
> This project is in danger of being canceled and here I am stuck.
I wrote a quick script to see if it could write to friends and put working
values for mod_auth:
_____
<?php
$users = array('jon'=>'secret',
'tom'=>'secret',
'sue'=>'secret');
$fp = fopen("friends","a");
foreach ($users as $u=>$p)
{
$pwd = crypt($p);
$line = "$u:$pwd\n";
fwrite($fp, $line);
}
fclose($fp);
print "<pre>\n";
readfile("friends");
print "</pre>\n";
?>
_____
This wrote three users and three passwords to friends:
jon:$1$xLsbVke1$qJ.cnfUcdpvpx5K2/U1BE1
tom:$1$mNk/kfgL$a3vREFsvkFCr7OFaeC8gJ/
sue:$1$Ai82whtF$E9zTQGJ9WQ6aeG3SDZUeZ0
To use it I set up a directory on my server called /www/keeline/marion and it
has a .htaccess file:
_____
AuthName Marion
AuthType Basic
AuthUserFile "/www/keeline/marion/friends"
require valid-user
_____
(note the blank line and valid-user in lower case)
I can log in with jon and secret.
See if you can log in with one of these username passwords:
http://www.Keeline.com/marion
James
James D. Keeline
http://www.Keeline.com http://www.Keeline.com/articles
http://Stratemeyer.org http://www.Keeline.com/TSCollection
http://www.ITeachPHP.com -- Free Computer Classes: Linux, PHP, etc.
Summer Semester Begins Jun 20 -- New Classes Start Every Few Weeks.
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12hf4m8bu/M=362335.6886445.7839731.1510227/D=groups/S=1705005703:TM/Y=YAHOO/EXP=1125015003/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In
low income neighborhoods, 84% do not own computers. At Network for Good, help
bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~->
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/