关于MD5加密及使用问题
我注册用户时候用MD5加密 查看数据库已经使用了MD5加密
可是在登陆的时候密码老是不对 什么原因
<!-- #include file="connn.asp"-->
<!--#include file="md5.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
exec="select * from pwd"
rs.open exec,conn,1,3
rs.addnew
rs("name")=trim(request.Form("name"))
rs("pwd")=md5(request.form("pwd"))
rs("qx")=request.Form("qx")
rs("by")=request.Form("by")
rs.update
%>
<script language="javascript">alert('发表成功!');location.href='zc.asp'</script>
<meta http-equiv="refresh" content="2;URL=fytj.asp">
<%
rs.close
set rs=nothing
%>
这是加密写进数据库过程
登陆验证的 还用加MD5吗 我在pwd=md5(request.Form("pwd"))加上也是登陆不了
<!-- #include file="connn.asp"-->
<!-- #include file="md5.asp"-->
<%
name=request.Form("name")
pwd=request.Form("pwd")
set rs=server.CreateObject("adodb.recordset")
sql="select * from pwd where name='"&name&"' and pwd='"&pwd&"'"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
response.write "<script language=javascript>"
response.write "alert('用户或密码不对!');"
response.write "javascript:history.go(-1);"
response.write "</script>"
else
if rs("qx")=true then
session("name")=name
response.write"<SCRIPT language=JavaScript>alert('登陆成功');"
response.write"this.location.href='fytj.asp';</SCRIPT>"
else
session("name")=name
response.write"<SCRIPT language=JavaScript>alert('登陆成功');"
response.write"this.location.href='fytj.asp';</SCRIPT>"
end if
end if
%>