ASP怎么得到登陆之后的用户名
这代码是XML+ASP判断的代码,书ur用户和密码成功就跳到default.asp也面怎么在default.asp页面显示得到的用户名?<styletype="text/...
这代码是XML+ASP判断的代码,书ur用户和密码成功就跳到default.asp也面怎么在default.asp页面显示得到的用户名?
<style type="text/css">
<!--
body {
background-image: url(bj/bj.gif);
}
.STYLE1 {font-size: 16px}
.STYLE2 {
font-size: 12px;
font-weight: bold;
}
-->
</style><%@ language="vbscript"%>
<% session("user") %>
<%
'访问childNodes()方法访问文档
user=request("user")
password=request("password")
response.write("<center><h3>你输入的用户名和密码</h3></center>")
response.write("<table width=180 height=50 border=1 align=center cellspacing=1 bordercolor=#000000>")
response.write("<tr><th bordercolor=#CC99FF bgcolor=#CC99FF>用户名</th>")
response.write("<th bordercolor=#CC99FF bgcolor=#CC99FF>密码</th>")
response.write("</tr><tr><th bordercolor=#99CCCC bgcolor=#99CCCC>"+user+"</th>")
response.write("<th bordercolor=#99CCCC bgcolor=#99CCCC>"+password+"</th>")
response.write("</tr></table>")
set xmldoc=server.createObject("MSXML.DOMDocument")
xmldoc.load(Server.MapPath("user.xml"))
set nodes=xmldoc.selectNodes("//用户")
if nodes.length<>0 then
Response.write("<center><h2>正确的登陆信息列表</h2></center>")
Response.write("<table width=255 border=1 align=center cellpadding=5 bordercolor=#000000>")
Response.write("<thead>")
response.write("<th bordercolor=#CC99FF bgcolor=#CC99FF>编号</th><th bordercolor=#CC99FF bgcolor=#CC99FF>用户名</th><th bordercolor=#CC99FF bgcolor=#CC99FF>密码</th>")
Response.write("</thead>")
for i=0 to nodes.length-1
Response.write("<tr align=center>")
str1=nodes(i).childNodes(0).text
str2=nodes(i).childNodes(1).text
x=i+1
Response.write("<td bordercolor=#99CCCC bgcolor=#99CCCC>"+cstr(x)+"</td>")
Response.write("<td bordercolor=#99CCCC bgcolor=#99CCCC>"+str1+"</td>")
Response.write("<td bordercolor=#99CCCC bgcolor=#99CCCC>"+str2+"</td>")
if user=str1 then
if password=str2 then
response.redirect("default.asp")
end if
else
response.write("您的登陆信息不正确!")
end if
next
end if
Response.write("</table>")
Response.write("<div align=center><a href=index.htm class=STYLE1>返回</a>")
Response.write("<span class=STYLE2>登陆页面</span></div>")
Response.end
%>
<>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><a href="index.htm" class="STYLE1">返回</a><span class="STYLE2">登陆页面</span> </p>
</div> 展开
<style type="text/css">
<!--
body {
background-image: url(bj/bj.gif);
}
.STYLE1 {font-size: 16px}
.STYLE2 {
font-size: 12px;
font-weight: bold;
}
-->
</style><%@ language="vbscript"%>
<% session("user") %>
<%
'访问childNodes()方法访问文档
user=request("user")
password=request("password")
response.write("<center><h3>你输入的用户名和密码</h3></center>")
response.write("<table width=180 height=50 border=1 align=center cellspacing=1 bordercolor=#000000>")
response.write("<tr><th bordercolor=#CC99FF bgcolor=#CC99FF>用户名</th>")
response.write("<th bordercolor=#CC99FF bgcolor=#CC99FF>密码</th>")
response.write("</tr><tr><th bordercolor=#99CCCC bgcolor=#99CCCC>"+user+"</th>")
response.write("<th bordercolor=#99CCCC bgcolor=#99CCCC>"+password+"</th>")
response.write("</tr></table>")
set xmldoc=server.createObject("MSXML.DOMDocument")
xmldoc.load(Server.MapPath("user.xml"))
set nodes=xmldoc.selectNodes("//用户")
if nodes.length<>0 then
Response.write("<center><h2>正确的登陆信息列表</h2></center>")
Response.write("<table width=255 border=1 align=center cellpadding=5 bordercolor=#000000>")
Response.write("<thead>")
response.write("<th bordercolor=#CC99FF bgcolor=#CC99FF>编号</th><th bordercolor=#CC99FF bgcolor=#CC99FF>用户名</th><th bordercolor=#CC99FF bgcolor=#CC99FF>密码</th>")
Response.write("</thead>")
for i=0 to nodes.length-1
Response.write("<tr align=center>")
str1=nodes(i).childNodes(0).text
str2=nodes(i).childNodes(1).text
x=i+1
Response.write("<td bordercolor=#99CCCC bgcolor=#99CCCC>"+cstr(x)+"</td>")
Response.write("<td bordercolor=#99CCCC bgcolor=#99CCCC>"+str1+"</td>")
Response.write("<td bordercolor=#99CCCC bgcolor=#99CCCC>"+str2+"</td>")
if user=str1 then
if password=str2 then
response.redirect("default.asp")
end if
else
response.write("您的登陆信息不正确!")
end if
next
end if
Response.write("</table>")
Response.write("<div align=center><a href=index.htm class=STYLE1>返回</a>")
Response.write("<span class=STYLE2>登陆页面</span></div>")
Response.end
%>
<>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><a href="index.htm" class="STYLE1">返回</a><span class="STYLE2">登陆页面</span> </p>
</div> 展开
2个回答
2009-11-23
展开全部
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询