.htaccess 編碼 - BBS
By Edward Lewis
at 2004-06-06T19:33
at 2004-06-06T19:33
Table of Contents
.htaccess 在產生密碼檔(.passwd)時 一般是下指令
#htpasswd .passwd username
New password:
Re-type new password:
欲寫一個php程式 更改.htaccess 的密碼檔 (.passwd)
好像不是MD5 請問他是怎樣編碼的~~
http://www.euronet.nl/~arnow/htpasswd/
---附上簡短程式---
<?
$name=$_POST["Name"];
$passwd=$_POST["Password"];
$passwd2=$_POST["Password2"];
if ($passwd == $passwd2)
{
print "姓名: ".$name."<br>";
print "密碼: ".$passwd."<br>";
$enc_passwd = md5($passwd); //這一行
$content = "$name:$enc_passwd";
$filename = ".passwd";
if (!file_exists($filename)) {
$file = fopen ($filename,"w");
fclose ($file);
}
$file = fopen ($filename,"w");
fputs ($file , $content);
fclose ($file);
}
else {
print "密碼不符合 請從新輸入";
}
?>
--
Tags:
BBS
All Comments
Related Posts
Re: 請問c中的pow()
By Queena
at 2004-06-06T06:40
at 2004-06-06T06:40
關於最近釋出的 mysql 4.1.2 alpha 的 …
By Annie
at 2004-06-03T23:32
at 2004-06-03T23:32
Re: 第一次接觸FreeBSD
By Hazel
at 2004-06-03T23:31
at 2004-06-03T23:31
Re: 第一次接觸FreeBSD
By Olive
at 2004-06-03T20:09
at 2004-06-03T20:09
Re: 第一次接觸FreeBSD
By Candice
at 2004-06-03T20:04
at 2004-06-03T20:04