验证页面源码如下,环境是winnt+iis4.0:
<!--#include file="asp/sqlstr.asp"-->
<!--#include file="asp/opendb.asp"-->
<%
Dim username
Dim password
Dim allow
allow=0
username=request("LoginName")
password=request("Password")
if username<>"" and password<>"" then
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
sql="select * from userinf where username=" & sqlstr(username)
rs.open sql,conn,1
if (not rs.eof) then
if (trim(rs("password")))=password then
allow=1
end if
else
allow=2
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
if allow=1 then
' session("username")=username
response.redirect "../index.htm"
else
response.redirect "../opportunities/fail1.htm"
end if
end if
%>
index.htm是一个框架页面,包含a,b,c三个页面,我在a页面中取出session的值,如:<%a=session("username")%>,但是得不到
孟老大,请帮忙
<!--#include file="asp/sqlstr.asp"-->
<!--#include file="asp/opendb.asp"-->
<%
Dim username
Dim password
Dim allow
allow=0
username=request("LoginName")
password=request("Password")
if username<>"" and password<>"" then
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
sql="select * from userinf where username=" & sqlstr(username)
rs.open sql,conn,1
if (not rs.eof) then
if (trim(rs("password")))=password then
allow=1
end if
else
allow=2
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
if allow=1 then
' session("username")=username
response.redirect "../index.htm"
else
response.redirect "../opportunities/fail1.htm"
end if
end if
%>
index.htm是一个框架页面,包含a,b,c三个页面,我在a页面中取出session的值,如:<%a=session("username")%>,但是得不到
孟老大,请帮忙
解决方案 »
- javascript 网站流量统计 代码
- 新手求助,刚学js
- JS日期控件
- document.form1.cb[i].checked 变量问题一直没搞明白!
- 关于用JavaScript控制网页刷新的问题
- 提问一个小问题:在看别人留下的代码中有一段javascript角本:前面有一段后面直接跟了个:void(0);这是什么意思呀?
- click 事件,改变颜色。。。。在线等待!
- 请问如何知道一个TEXT是否已经获得焦点???在线等
- 用JAVASCRIPT 生成类似左边那样的动态菜单?
- 怎么实现dreamweaver添加热点的功能
- 如何在JS里面改變TABLE的TD的BGCOLOR?(在線等待,立即給分!)
- JavaScript迷惑问题之九:如何对URL进行编码?
您设置Session的页面正确吗?