| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 941 人关注过本帖
标题:一个不知原因的问题,asp或iis出错
只看楼主 加入收藏
weaver
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2004-9-11
收藏
 问题点数:0 回复次数:3 
一个不知原因的问题,asp或iis出错

代码如下: <!--#include file="common.asp"--> <!--#include file="top.asp"--> <% session.Abandon select case request("act") case "admchk" call admchk() case "logout" call logout() case else call login() end select

sub login() %> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>无标题文档</title> <style type="text/css"> <!-- body { font-family: Verdana, Arial, "宋体", Tahoma; color: #003366; background-color: #FFFFFF; } .table1 { border: 1px #555555;background-color: #555555; } A:link,A:active,A:visited { color: #003366; text-decoration: none; } a:hover { color: #000000; text-decoration: underline; } .style2 {font-size: 9pt} --> </style> </head>

<body> <form action="?act=admchk" method="POST"> <table border="0" cellpadding="0" cellspacing="1" style="border-collapse: collapse " bordercolor="#666666" width="100%" height="70%"> <tr> <td width="43%" height="80" valign="bottom"><img src="/images/admin.gif" width="30" height="27" border="0" align="right"></td> <td width="57%" height="80" valign="bottom"> <p align="left" class="style2"><b>管理登陆</b></td> </tr> <tr> <td width="100%" height="234" colspan="2" align="center" valign="top"> <div align="center"> <center> <table border="0" cellpadding="3" cellspacing="1" class="table1" width="70%"> <tr> <td width="40%" height="17" bgcolor="#FFF3C4" class="tablebody3"> <p align="right"><span class="style2">用户名称</span>:</td> <td width="60%" height="17" bgcolor="#E1E9F0" class="tablebody2"><input type="text" name="name" size="20"></td> </tr> <tr> <td width="40%" height="35" bgcolor="#FFF3C4" class="tablebody3"> <p align="right"><span class="style2">用户密码</span>:</td> <td width="60%" height="35" bgcolor="#E1E9F0" class="tablebody2"><input type="password" name="password" size="20"></td> </tr> <tr> <td width="40%" height="35" align="right" bgcolor="#FFFFFF" class="style2">注意:大小写敏感</td> <td width="60%" height="35" bgcolor="#FFFFFF" class="tablebody1"><input type="submit" value="提交" name="B1">&nbsp;&nbsp;<input type="reset" value="重置" name="B2"></td> </tr> </table> </center> </div> </td> </tr> </table> </form> <% end sub

sub admchk()

dim username,password username=trim(request("name")) password=trim(request("password"))

sql="Select username,password,level1 From [user] where username='"&username&"'" set rs=server.CreateObject("adodb.recordset") rs.open sql,conn,1,3 if rs.eof then errinfo="名称或密码错误,请注意大小写。" error(errinfo) rs.close set rs=nothing conn.close set conn=nothing response.End end if if not (rs("password")=password) then errinfo="名称或密码错误,请注意大小写。" error(errinfo) rs.close set rs=nothing conn.close set conn=nothing response.End end if session("username")= rs("username") session("userlevel")=rs("level1")

if session("userlevel")=1 then response.Redirect"admin.htm" elseif session("userlevel")=2 then response.Redirect"teacher.htm" elseif session("userlevel")=3 then response.Redirect"student.asp" end if

rs.close set rs=nothing end sub %> <!--#include file="foot.asp"--> </body> </html>

实在不知道是iis或asp的问题,标题不太明确,抱歉

运行以上代码,用帐号登陆后,有时候可以进去,有时候又不行,此时页面显示 由于网页地址不正确,正在查找的网页无法显示。 HTTP 错误 405 - 禁止访问资源 好心人们帮帮忙啊

[此贴子已经被作者于2004-09-11 12:19:23编辑过]

搜索更多相关主题的帖子: iis asp 
2004-09-11 12:17
griefforyou
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:3336
专家分:0
注 册:2004-4-15
收藏
得分:0 
用调试工具更踪一下吧

天津网站建设 http://www./
2004-09-11 12:40
weaver
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2004-9-11
收藏
得分:0 
我的调试器不能自行启动啊,我点选了“启动asp服务器端脚本调试”的,怎么回事啊?教我
2004-09-11 15:11
griefforyou
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:3336
专家分:0
注 册:2004-4-15
收藏
得分:0 
。。。

天津网站建设 http://www./
2004-09-11 17:51
快速回复:一个不知原因的问题,asp或iis出错
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014675 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved