提交运行,我设置的事件,不运行问题
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn/my_conn.asp"-->
<!--#include file="../str_filter.asp"-->
<!--#include file="../md5.asp"-->
<% function login() admin=str_filter(request.Form("admin"))
pwd=md5(str_filter(request.Form("pwd")))
code=str_filter(request.Form("code"))
if admin="" or pwd="" then
response.write "<script LANGUAGE='javascript'>alert('您的用户名或密码有误!');</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from [bout_admin] where admin='"&admin&"' " ,conn,1,3
if rs("code")<>code then
response.Write("<script language='javascript'>arert('你的验证码不正确,请与管理员联系!');</script>")
response.end
end if
if rs("lock")=1 then
response.Write("<script language='javascript'>arert('你的用户名已被锁定,请与管理员联系!');</script>")
else
if pwd=rs("pwd") then
session("admin")=admin
session("admin_name")=rs("admin_name")
session("pwd")=rs("pwd")
session("flag")=rs("flag")
response.Redirect(index.asp)
else
response.write "<script LANGUAGE='javascript'>alert('您的用户名或密码有误!');</script>"
end if
end if
end function
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="../css/admin_css.css" rel="stylesheet" type="text/css">
<title>注意安全</title>
<script language="JavaScript">
<!--
function IsDigit()
{
return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
//-->
</script>
</head>
<body>
<table width="1004" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="587" background="image/login_back.gif"><table width="833" height="183" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="183" colspan="2"> </td>
<td width="520" colspan="3">
<form id="form1" name="form1" method="post" action="" onsubmit="return login();">
<table width="331" height="131" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="101"> </td>
<td colspan="3"> </td>
<td width="85"> </td>
</tr>
<tr>
<td align="right">管理ID:</td>
<td colspan="3">
<input name="admin" type="text" size="16" maxlength="15" /> </td>
<td> </td>
</tr>
<tr>
<td align="right">密 码 :</td>
<td colspan="3">
<input name="pwd" type="password" size="16" maxlength="15" /> </td>
<td> </td>
</tr>
<tr>
<td align="right">验证码:</td>
<td colspan="3" align="left">
<input name="code" type="text" size="10" onKeyPress="event.returnValue=IsDigit();" maxlength="10" /> </td>
<td> </td>
</tr>
<tr>
<td align="right"><input type="submit" name="Submit" value="提交" /></td> <td width="13"></td>
<td width="52" align="left"><input type="reset" name="Submit2" value="重置" /></td>
<td width="80" align="left"><input type="button" name="Submit3" onclick="window.location.href='admin_reg.asp'" value="注册" /></td>
<td> </td>
</tr>
</table>
</form>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<!--#include file="../conn/my_conn.asp"-->
<!--#include file="../str_filter.asp"-->
<!--#include file="../md5.asp"-->
<% function login() admin=str_filter(request.Form("admin"))
pwd=md5(str_filter(request.Form("pwd")))
code=str_filter(request.Form("code"))
if admin="" or pwd="" then
response.write "<script LANGUAGE='javascript'>alert('您的用户名或密码有误!');</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from [bout_admin] where admin='"&admin&"' " ,conn,1,3
if rs("code")<>code then
response.Write("<script language='javascript'>arert('你的验证码不正确,请与管理员联系!');</script>")
response.end
end if
if rs("lock")=1 then
response.Write("<script language='javascript'>arert('你的用户名已被锁定,请与管理员联系!');</script>")
else
if pwd=rs("pwd") then
session("admin")=admin
session("admin_name")=rs("admin_name")
session("pwd")=rs("pwd")
session("flag")=rs("flag")
response.Redirect(index.asp)
else
response.write "<script LANGUAGE='javascript'>alert('您的用户名或密码有误!');</script>"
end if
end if
end function
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="../css/admin_css.css" rel="stylesheet" type="text/css">
<title>注意安全</title>
<script language="JavaScript">
<!--
function IsDigit()
{
return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
//-->
</script>
</head>
<body>
<table width="1004" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="587" background="image/login_back.gif"><table width="833" height="183" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="183" colspan="2"> </td>
<td width="520" colspan="3">
<form id="form1" name="form1" method="post" action="" onsubmit="return login();">
<table width="331" height="131" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="101"> </td>
<td colspan="3"> </td>
<td width="85"> </td>
</tr>
<tr>
<td align="right">管理ID:</td>
<td colspan="3">
<input name="admin" type="text" size="16" maxlength="15" /> </td>
<td> </td>
</tr>
<tr>
<td align="right">密 码 :</td>
<td colspan="3">
<input name="pwd" type="password" size="16" maxlength="15" /> </td>
<td> </td>
</tr>
<tr>
<td align="right">验证码:</td>
<td colspan="3" align="left">
<input name="code" type="text" size="10" onKeyPress="event.returnValue=IsDigit();" maxlength="10" /> </td>
<td> </td>
</tr>
<tr>
<td align="right"><input type="submit" name="Submit" value="提交" /></td> <td width="13"></td>
<td width="52" align="left"><input type="reset" name="Submit2" value="重置" /></td>
<td width="80" align="left"><input type="button" name="Submit3" onclick="window.location.href='admin_reg.asp'" value="注册" /></td>
<td> </td>
</tr>
</table>
</form>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
...全文
相关推荐
解决layui中的form表单与button的点击事件冲突问题
今天小编就为大家分享一篇解决layui中的form表单与button的点击事件冲突问题,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
jquery submit()不能提交表单的解决方法
主要为大家详细介绍了jquery submit()不能提交表单的解决方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
form.submit()不能提交表单的错误原因及解决方法
button的id不要设置为submit,否则可能会引起混淆,导致表单的submit()方法不能提交表单
ajaxFileUpload重复提交,出现参数 is not params现象
NULL 博文链接:https://yingyingsheji.iteye.com/blog/2398867
验证控件与Button的OnClientClick事件详细解析
以下就是被我已知忽略的问题和解决方案,当我发觉这个问题的时候,冒出了一身冷汗,幸亏做了严格的服务器端验证,不然可就惨了


