| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 488 人关注过本帖
标题:asp登录程序实现不了功能
取消只看楼主 加入收藏
朦胧岁月
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-4-18
结帖率:0
收藏
已结贴  问题点数:20 回复次数:0 
asp登录程序实现不了功能
我在学习asp 编写的简单登录程序没有报错 但点击登录没有跳转   我数据库 和 下游界面都做了 请高手解答
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="conn.asp"-->
<%
if Ucase(trim(request.ServerVariables("request_method")))="post" then
dim sadminname
dim sadminpassword
'dim message-logined
  sadminname = trim(request.Form("txtadminname"))
  sadminpassword = trim(request.Form("txtadminpassword"))
   sadminname=replace(txtadminname,"","")
 sadminpassword=replace(txtadminpassword,"","")
dim sql
dim ors
sql="select * from [admin] where adminname = '"&sadminname &"' and adminpassword='"&sadminpassword &"'"

set ors=server.CreateObject("ADODB.recordset")
ors.open sql,oconn,1,3
if ors.eof and ors.bof then
  response.Write("您输入的用户名或密码错误!请<a href=""login.asp"">点击这里</a>重新登录!")
  ors.close
   set ors=nothing
   oconn.close
   set oconn=nothing
  
   response.end
else
   
  session("message-logined")=true   
 
   ors.close
   set ors=nothing
   oconn.close
   set oconn=nothing
   
   response.Write("<script type=""text/javascript"">alert('您已经成功登录!');location.href='default.asp'")
  
   
  end if
  %>

<!DOCTYPE html public"-//w3c//dtd xhtml 1.0 transitional//en" "http://www.
xhtml1/dtd/xhtm11-transitional.dtd">
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<title>WeMessage 留言本示例</title>
<link href="style.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
body,td,th {
    color: #000;
}
</style>
</head>
<body class="onecolliqctrhdr">
<div id="container">
<div id="header">
<h1>Wemessage 留言本实例</h1>
</div>
<div id="maincontent">
<h2>管理员登录</h2>

<form id="frmlogin" name="frmlogin" method="post" action="">
<p>
<label for="txtAdminName">用户名:</label>
<input type="text" name="txtAdminName" id="txtadminName"
onfocus="this.classname='input-focus'" onblur="this.classname='input-blur'" class="input-blur" />
<label for="txtmessageUser"></label>
<span class="red">*</span></p>
<p>
<label for="txtpassword">密 &nbsp;码:</label>
<input type="password" name="txtadminpassword" id="txtadminpassword"
onfocus="this.classname='input-focus'" onblur="this.classname='input-blur'" class="input-blur" />
<span class="red">*</span></p>
<p>
<label for="btnsubmit"></label>
<input type="submit" name="btnsubmit" id="btnsubmit" value="提交"/>
<input type="reset" name="btnreset" id="btnreset" value="重置"/>
</p>
</form>
</div>
<div id="footer">
<p>copyrights&copy;2007 wemessage</p>
     <div id="footer2">
       <p><a href="#">管理员登录</a></p>
     </div>
 </div>
   </div>
</body>
   </html>
搜索更多相关主题的帖子: 数据库 
2011-04-27 10:45
快速回复:asp登录程序实现不了功能
数据加载中...
 
   



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

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