
ASP缺少对象疑问
行:97字符:1错误:缺少对象/*if(checkemail('yan')==0){document.getElementById('yan').focus();retu...
行:97
字符:1
错误:缺少对象
/*
if (checkemail('yan')==0) {
document.getElementById('yan').focus();
return false;
}
*/
整篇代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="setup.asp"-->
<!--#include file="conn.asp"-->
<!--#include file = "md5.asp"-->
<%
' 初始化数据库连接
Dim sAction, sErrMsg
Dim wumei_usr, wumei_pwd
sAction = UCase(Trim(Request("action")))
sErrMsg = ""
Select Case sAction
Case "LOGIN"
Set oRs = Server.CreateObject( "ADODB.Recordset" )
wumei_usr = HX_Replace(Trim(Request.form("usr")))
wumei_pwd = HX_Replace(Trim(Request.form("pwd")))
if cstr(Session("wumei_GetCode"))=HX_Replace(trim(request.Form("yan"))) then
If wumei_usr <> "" And wumei_pwd <> "" Then
sSql = "select * from wumei_cust where cust_name='"&wumei_usr&"'"
oRs.Open sSql, conn, 0, 1
If Not oRs.Eof Then
If oRs("cust_name") = wumei_usr And oRs("cust_pass") = md5(wumei_pwd) Then
' 登录成功
Session("cust_name") = wumei_usr
Session("cust_id") = oRs("id")
Session("true_name") = oRs("truename")
Response.Redirect "cust_admin_index.asp"
Response.End
End If
End If
oRs.Close
End If
else
response.Write "<script LANGUAGE='javascript'>alert('请输入正确的验证码!');history.go(-1);</script>"
response.end
end if
sErrMsg = "提示:用户名或密码错误!"
Case "OUT"
Session.Abandon()
End Select
' 释放数据连接对象
connclose
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=site_name%></title>
<script language="JavaScript" src="checkform.js"></script>
<SCRIPT language=JavaScript>
function checklogin(){
if (document.myform.usr.value=="") {
alert("请输入用户名!");
myform.usr.focus();
return false;
}
if (document.myform.pwd.value=="") {
alert("请输入密码!");
myform.pwd.focus();
return false;
}
if (document.myform.yan.value=="") {
alert("请输入验证!");
myform.pwd.focus();
return false;
}
if( isNumberString(document.myform.yan.value,"1234567890")!=1 || document.myform.yan.value.length<2 || document.myform.yan.value.length>20) {
alert("\验证码输入出错,下面是产生错误的可能原因:\n\n· 用户名必须是2-20位的数字")
return false;
}
/*
if (checkemail('yan')==0) {
document.getElementById('yan').focus();
return false;
}
*/
return true;
}
</SCRIPT>
... 展开
字符:1
错误:缺少对象
/*
if (checkemail('yan')==0) {
document.getElementById('yan').focus();
return false;
}
*/
整篇代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="setup.asp"-->
<!--#include file="conn.asp"-->
<!--#include file = "md5.asp"-->
<%
' 初始化数据库连接
Dim sAction, sErrMsg
Dim wumei_usr, wumei_pwd
sAction = UCase(Trim(Request("action")))
sErrMsg = ""
Select Case sAction
Case "LOGIN"
Set oRs = Server.CreateObject( "ADODB.Recordset" )
wumei_usr = HX_Replace(Trim(Request.form("usr")))
wumei_pwd = HX_Replace(Trim(Request.form("pwd")))
if cstr(Session("wumei_GetCode"))=HX_Replace(trim(request.Form("yan"))) then
If wumei_usr <> "" And wumei_pwd <> "" Then
sSql = "select * from wumei_cust where cust_name='"&wumei_usr&"'"
oRs.Open sSql, conn, 0, 1
If Not oRs.Eof Then
If oRs("cust_name") = wumei_usr And oRs("cust_pass") = md5(wumei_pwd) Then
' 登录成功
Session("cust_name") = wumei_usr
Session("cust_id") = oRs("id")
Session("true_name") = oRs("truename")
Response.Redirect "cust_admin_index.asp"
Response.End
End If
End If
oRs.Close
End If
else
response.Write "<script LANGUAGE='javascript'>alert('请输入正确的验证码!');history.go(-1);</script>"
response.end
end if
sErrMsg = "提示:用户名或密码错误!"
Case "OUT"
Session.Abandon()
End Select
' 释放数据连接对象
connclose
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=site_name%></title>
<script language="JavaScript" src="checkform.js"></script>
<SCRIPT language=JavaScript>
function checklogin(){
if (document.myform.usr.value=="") {
alert("请输入用户名!");
myform.usr.focus();
return false;
}
if (document.myform.pwd.value=="") {
alert("请输入密码!");
myform.pwd.focus();
return false;
}
if (document.myform.yan.value=="") {
alert("请输入验证!");
myform.pwd.focus();
return false;
}
if( isNumberString(document.myform.yan.value,"1234567890")!=1 || document.myform.yan.value.length<2 || document.myform.yan.value.length>20) {
alert("\验证码输入出错,下面是产生错误的可能原因:\n\n· 用户名必须是2-20位的数字")
return false;
}
/*
if (checkemail('yan')==0) {
document.getElementById('yan').focus();
return false;
}
*/
return true;
}
</SCRIPT>
... 展开
2个回答
展开全部
这是脚本报错
if (checkemail('yan')==0) { ----------------》这里出错
document.getElementById('yan').focus();
return false;
}
*/
if (checkemail('yan')==0) { ----------------》这里出错
document.getElementById('yan').focus();
return false;
}
*/
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询