在线增减.htpasswd内的用户
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
线增减.htpasswd内的用户

<?php  
include("./class.htpasswd.php3");  

/* 请修改此.htpasswd文件路径  
*/  
$htpasswdfile = "/usr2/amitc/.htpasswd";  


// 此行请勿修改  
echo '<FORM ACTION="'.$PHP_SELF . '" METHOD=POST>';  
?>  
<Table BORDER><TR>  
<TD>Username: </TD>  
<TD><INPUT TYPE=text name="username"></TD>  
</TR><TR>  
<TD>Password: </TD>  
<TD><INPUT TYPE=text name="password"></TD>  
</TR><TR>  
<TD>  
<INPUT TYPE=radio NAME=doop VALUE="verify" CHECKED> Verify Password <BR>  
<INPUT TYPE=radio NAME=doop VALUE="add" > 加入新用户<BR>  
<INPUT TYPE=radio NAME=doop VALUE="delete" > 删除用户 <BR>  
<INPUT TYPE=radio NAME=doop VALUE="change" > 更改密码 <BR>  
</TD>  
<TD>  
<INPUT TYPE=submit name="operation">  
</TD></TR>  
</TR>  
</TABLE>  
</FORM>  
<?php  
if(!isset($operation)) {  
}  
else {  
echo "<FONT COLOR=RED> <HR>";  
echo "您刚进行了此项操作,请核查 <BR><HR>";  
echo "您要对用户 $username 及密码 $password 进行 = [$doop] <BR>";  
$handle = new htpasswd($htpasswdfile);  

switch ($doop) {  
case 'add':  
print "用户<BR>";  
$retval = $handle->addUser($username, $password);  
if($retval) {  
print "用户 [$username] 加入成功!<BR>";  
} else {  
print "加入用户 [$username] 失败.<BR>";  
}  
break;  

case 'change':  
print '修改密码<BR>';  
$retval = $handle->changePass($username, $password);  
if($retval) {  
print "[$username] 的密码修改成功.<BR>";  
} else {  
print "[$username] 的密码修改失败.<BR>";  
}  
break;  

case 'delete':  
print '删除用户<BR>';  
$retval = $handle->deleteUser($username);  
if($retval) {  
print "[$username] 被删除.<BR>";  
} else {  
print "删除 [$username]时发生错误.<BR>";  
}  
break;  

case 'verify':  
print 'Code to verify user's password<BR>';  
$retval = $handle->verifyUser($username, $password);  
if($retval) {  
print "[$username] verifies okay with password [$password]<BR>";  
} else {  
print "Verify Error for [$username] with [$password] (wrong password or user doesn't exist!) <BR>";  
}  

break;  

default:  
print '您要中断? <BR>';  
}  
echo "</FONT>";  
}  
?>   <script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
阅读更多
文章标签: delete user action php
个人分类: 网络技术
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

在线增减.htpasswd内的用户

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭