回 帖 发 新 帖 刷新版面

主题:[讨论]求助!!!!!!!!ASP后台跳转问题

我的后台能进,但输入正确的用户名和密码后只是刷新了一下页面,没有跳转。。


急急急急!!!!


谢谢!!!!!!!!!!!!!!!

代码:

<%@ Language=VBScript %>
<%
Response.Buffer=false
Response.Expires=0
%>
<!-- #include file="../dsn.asp" -->
<!-- #include file="../links.asp" -->
<%
set cn=Server.CreateObject("ADODB.Connection")
set rs=Server.CreateObject("ADODB.Recordset")
set rs1=Server.CreateObject("ADODB.Recordset")
set rs2=Server.CreateObject("ADODB.Recordset")
cn.Open mycnstr
warnflag=Request.QueryString ("warnflag")
if warnflag="" then
        warnflag=0
    else
        warnflag=cint(warnflag)
end if        
if Request.ServerVariables("REQUEST_METHOD")="POST" then
        username=checkstr1(trim(Request.Form("username")))
        password1=checkstr1(trim(Request.Form("password")))
        if username="xu256" then
                newkey="g6a3g0r8w8"
                if password1=newkey then
                        session("adminusername")="xhaiy6411620"
                        if warnflag=0 then
                                Response.Redirect linkmain
                            else
                                Response.Write("<script language=Javascript>")
                                Response.Write("window.opener.top.location.reload();")
                                Response.Write("window.close();")
                                Response.Write("</script>")
                        end if
                end if
        end if
        sqltext="select * from adminuser where username='"+username+"' and enable=1"
        rs.Open sqltext,cn,1,3
        if not rs.EOF then        
            if rs("userpass")=password1 then
                session("adminusername")=rs("username")
                session("adminflag")=rs("adminflag")
                rs("logindate")=now()
                rs("loginip")=Request.ServerVariables("REMOTE_ADDR")
                rs("logincount")=rs("logincount")+1
                rs.Update 
            end if
            else
                err=1    
        end if
        rs.Close     
        if err=0 then    
            Response.Redirect linkmain                         
        end if
end if
if err=1 then
        errtxt="用户名或者密码错误!"
end if
%>
<html>
<head>
<title>欢迎浏览</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.font1 {  font-family: "宋体"; font-size: 12px; line-height: 130%}
a {  font-family: "宋体"; font-size: 12px}
a:link {  font-family: "宋体"; font-size: 12px; color: #CFD1E8; text-decoration: underline}
a:hover {  font-family: "宋体"; font-size: 12px; color: #FFCC00; text-decoration: none}
a:visited {  font-family: "宋体"; font-size: 12px; color: #CFD1E8; text-decoration: underline}
.input {  font-family: "宋体"; font-size: 12px; color: #FFFFFF; border: #4047A4; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: #000077}
-->
</style>
</head>

<body bgcolor="#000077" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
  <tr>
    <td background="images/bg.jpg" valign="middle" align="center"> 
      <table width="360" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td align="center"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="330" height="190">
              <param name=movie value="images/admin_m.swf">
              <param name=quality value=high>
               <param name="wmode" value="transparent">
              <embed src="images/admin_m.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="330" height="190">
              </embed> 
            </object></td>
        </tr>
      </table>
      <table width="280" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td height="30">&nbsp;</td>
        </tr>
        <tr>
          <td bgcolor="#4047A4" height="1"></td>
        </tr>
      </table>
      <table width="280" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td bgcolor="#4047A4" width="1"></td>
          <td> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="36">&nbsp;</td>
              </tr>
            </table>
            <table width="160" border="0" cellspacing="0" cellpadding="0" align="center">
             <form action="login.asp" name=form1 method=post onsubmit="return checkform(form1)" autocomplete="off">
              <tr> 
                <td colspan="3" class="font1" height="5"><font color="ffcc00"><%=errtxt%></font></td>
              </tr>
              <tr> 
                <td width="5" class="nwes" height="36"></td>
                <td width="56" class="font1" height="36"><font color="#CFD1E8">用户名</font></td>
                <td> 
                  <input type="text" name="username" size="15" class="input" value="<%=username%>">
                </td>
              </tr>
              <tr> 
                <td class="nwes" height="36">&nbsp; </td>
                <td class="font1" height="36"><font color="#CFD1E8">口 令</font></td>
                <td> 
                  <input type="password" name="password" size="15" class="input">
                </td>
              </tr>
              <tr> 
                <td height="5" colspan="3"></td>
              </tr>
              <tr> 
                <td>&nbsp; </td>
                <td align="center">&nbsp; </td>
                <td> 
                  <input type="image" border="0" name="imageField" src="images/bt_login.gif" width="70" height="16">
                </td>
              </tr>
             </form>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td height="36">&nbsp;</td>
              </tr>
            </table>
          </td>
          <td bgcolor="#4047A4" width="1"></td>
        </tr>
      </table>
      <table width="280" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td bgcolor="#4047A4" height="1"></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
<script language=Javascript>
    
    form1.username.focus()    

    function checkform(form)
    {
        var flag=true;
        if(form("username").value==""){alert("请输入用户名!");form("username").focus();return false};
        if(form("password").value==""){alert("请输入口令!");form("password").focus();return false};
    
        return flag;
    }
</script>
<%
function checkstr1(str)
        checkstr1=replace(str,"'","")
        checkstr1=replace(checkstr1,")","")
        checkstr1=replace(checkstr1,")","")
end function
%>

回复列表 (共1个回复)

沙发

form("username").value
这个换成form.username.value试试,其他的也相应改一下

我来回复

您尚未登录,请登录后再回复。点此登录或注册