这段怎样加MD5 我注册后的用户密码都为 32位加密
我改成这样为什么不行
username =request("username")
userpassword =MD5(Request("userpassword,32"))
不改前源代码:
<!--#include file =conn.asp-->
<!--#include file =md5.asp-->
<%
dim rs_user
dim sql
dim username,userpassword
username =request("username")
userpassword =request("userpassword")
if userpassword="" or username="" then
response.write "<script language='javascript'>"
response.write "alert('数据填写有错!');"
response.write "history.go(-1);"
response.write "</script>"
response.end
end if
Set rs_user = Server.CreateObject("ADODB.Recordset")
sql="select * from hl_user where username like '" & username & "'and userpassword like '" & userpassword & "'"
rs_user.open sql,conn,3,2
if rs_user.eof and rs_user.bof then
%>
<html>
<head>
<style>
<!--
a:link { color: blue; text-decoration: none }
a:visited { color: blue; text-decoration: none }
a:active { color: #ff9966; text-decoration: none }
a:hover { color: red; text-decoration: none }
-->
</style>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>提示信息</title>
</head>
<body>
<div align="center">
<center>
<table border="1" width="400" bordercolor="#000000" cellspacing="0" cellpadding="0" height="120">
<tr>
<td width="100%" bgcolor="#000000" height="16">
<p align="center"><b><font color="#FFFFFF" size="3">错误提示</font></b></td>
</tr>
<tr>
<td width="100%" bgcolor="#EEEEEE" height="100">
<p align="center"><font size="2">用户名或密码错误!</font></p>
<p align="center"><font size="2"><a href="default.asp">[返回]</a></font></td>
</tr>
</table>
</center>
</div>
</body>
</html>
<%else
session("partyid")=rs_user("id")
session("partyusername")=rs_user("username")
rs_user.close
set rs_user=nothing
set conn=nothing
response.redirect "default.asp"
response.end
end if%>
[此贴子已经被作者于2007-4-19 10:13:38编辑过]