那么我在后一页用 strusername=session("username")
能把我在index.asp中输入的username给strusername吗???
如果不能请大侠们指教~~~~~~~~~~~~~~~~~~我应该怎么办?
index.asp
-----------------------------------------------------------------------
<form name="Login" action="ChkLogin.asp" method="post" >
chklogin.asp
-----------------------------------------------------------------------
<!--#include file="conn.asp"-->
<%
dim rs,sql
dim strusername,struserpassword
strusername=request.Form("username")
struserpassword=request.Form("userpassword")
set rs=server.CreateObject("adodb.recordset")
sql="select username,userpassword from user where username='"&strusername&"' and userpassword='"&struserpassword&"'"
rs.open sql,conn,1.3
if strusername="" then
response.write "<script language=javascript>alert('用户名不能为空!');history.back();</script >"
end if
if struserpassword="" then
response.write "<script language=javascript>alert('用户密码不能为空!');history.back();</script >"
end if
if rs.eof then
response.write "<script language=javascript> alert('您输入的用户名或密码不存在!');history.back();</script >"
else
session("username")="request.Form('"&username&"')"
session.Timeout=60
response.Redirect"admin.asp"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
admin.asp
--------------------------------------------------------------------
<form name="form2" method="post" action=""><label></label>
<div align="center" class="STYLE5"><a href="gly.asp">管理员查询系统</a></div>
</form>
gly.asp
-----------------------------------------------------------------------
<!--#include file="conn.asp"-->
<%
dim rs,sql
dim stradminname
stradminname=session("uername")
set rs=server.CreateObject("adodb.recordset")
sql="select adminname from admin where adminname='"&stradminname&"'"
rs.open sql,conn,1.1
if rs.eof then
response.Write"<script language=javascript>alert('您没有管理员权限!!!');history.back()</script>"
else
response.Redirect"select.asp"
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%>
这样可以吗?哪错了????请指教