请帮我看看执行这个ASP为什么出错??

bluesnowly 2004-04-08 10:34:13
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@LANGUAGE = "VBScript"%>
<%
function IsValidEmail(email)

dim names, name, i, c

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
%>
<HTML>
<HEAD>
<TITLE>checkemail </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>
<form name="form1" action="<%=Request.ServerVariables("SCRIPT_NAME")%>" method="post">
<table>
<tr>
<td>email</td>
<td><input type="text" name="email"></td>
<td><input type="button" name="b1" value="submit" onclick="return checkemail(email.value)"></td>
</tr>
</table>
</BODY>
</HTML>

运行的时候,老提示错误类型:
Microsoft VBScript 编译器错误 (0x800A0408)
无效字符
/cerc/web/board/Noname1.asp, line 11
 IsValidEmail = false

...全文
4 点赞 收藏 回复
写回复
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复

还没有回复,快来抢沙发~

发动态
发帖子
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
社区公告
暂无公告