[求助]显示用户资料问题
好像是判断里没有写入用户的资料!代码如下
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% dim name,password
dim db
db = "../cdms.mdb"
Set Conn = server.CreateObject("ADODB.CONNECTION")
Conn.open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath(db) & "")
name=request.Form("name")
password=request.form("password")
if name="" then
%><script language=javascript>
alert("帐号为空");
location.href="首页.asp"
</script>
<% end if %>
<%
if password="" then
%><script language=javascript>
alert("密码为空");
location.href="首页.asp"
</script>
<% end if %>
<title>登录判断</title>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from information where name='"&name&"' and password='"&password&"'"
rs.open sql,conn,1,3
if rs.eof then
response.write ("<script>alert('用户帐号密码错误');location.href('首页.asp')</script>")
response.End()
else
session("name")=name
session("niname")=niname
Response.write("<script>alert('登陆成功');location.href=('登录成功.asp')</script>" )
end if
%>
rs.close set rs=nothing conn.close set conn=nothing
session("name")=后面是不是加的name没有加值进去?说什么要用rs加个纪录集进去!我不会,请教大大!