代码编写问题~!

kbrw 2004-11-26 08:45:33
技术信息(用于支持人员)

错误类型:
Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配: 'IsValidEmail'
/asd/reg.asp, 第 21 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

我的语句是这样写的,请问错在何处?
〈%if request.Form("namer")="" then
errmsg=errmsg+"<br>"+"<li>您输入的姓名不能为空。"
else
namer=trim(request.Form("namer"))
end if%〉
...全文
52 点赞 收藏 8
写回复
8 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
lienzhu 2004-11-26
呵呵,贴重复了,那就再贴一个javascript吧!
function emailCheck(email)
{
txt=email.toLowerCase();
if (txt.length==0)
return false
if (txt.charAt(0)=="."||txt.charAt(0)=="@"||txt.indexOf('@', 0) ==-1||txt.indexOf('.', 0)==-1||txt.lastIndexOf("@")==txt.length-1||txt.lastIndexOf(".")==txt.length-1)
return false;
if ((txt.indexOf(".com")<5)&&(txt.indexOf(".org")<5)&&(txt.indexOf(".gov")<5)&&(txt.indexOf(".net")<5)&&(txt.indexOf(".mil")<5))
return false;
return true;
}

回复
msdner 2004-11-26
参考动网的。
回复
lienzhu 2004-11-26
function IsValidEmail(email)
dim names, name, i, c
'Check for valid syntax in an email address.
IsValidEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
IsValidEmail = false
exit function
end if
for each name in names
if Len(name) <= 0 then
IsValidEmail = false
exit function
end if
for i = 1 to Len(name)
c = Lcase(Mid(name, i, 1))
if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
IsValidEmail = false
exit function
end if
next
if Left(name, 1) = "." or Right(name, 1) = "." then
IsValidEmail = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
IsValidEmail = false
exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
IsValidEmail = false
exit function
end if
if InStr(email, "..") > 0 then
IsValidEmail = false
end if
end function
回复
777dragon 2004-11-26
IsValidEmail?? 动网的拿过来用下?_?



function IsValidEmail(email)
dim names, name, i, c

'Check for valid syntax in an email address.

IsValidEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
IsValidEmail = false
exit function
end if
for each name in names
if Len(name) <= 0 then
IsValidEmail = false
exit function
end if
for i = 1 to Len(name)
c = Lcase(Mid(name, i, 1))
if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
IsValidEmail = false
exit function
end if
next
if Left(name, 1) = "." or Right(name, 1) = "." then
IsValidEmail = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
IsValidEmail = false
exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
IsValidEmail = false
exit function
end if
if InStr(email, "..") > 0 then
IsValidEmail = false
end if

end function
回复
kbrw 2004-11-26
要是想判断用户输入的是不是EMAIL的地址,用VBSCRIPT应该怎么写呢~!
回复
kbrw 2004-11-26
应该怎么用呢
回复
777dragon 2004-11-26
?_?

〈% %〉 ----> <% %>


不会是因为这个吧~~
回复
bzscs 2004-11-26
错误是因为没有IsValidEmail这个函数,而你又进行了调用
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2004-11-26 08:45
社区公告
暂无公告