最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
二款asp 邮箱地址验证代码
时间:2022-06-29 13:48:24 编辑:袖梨 来源:一聚教程网
邮箱验证代码一
<%
function chkemail(email) '定义过程
chkemail=true '初始化函数结果
names=split(email,"@") 'split函数是将字符串用指定的字符分割成多个子字符串,并将这些子字符串保存在一维数组中
if ubound(names)<>1 then 'ubound函数返回数组的最大下标
chkemail=false '邮件格式错误,返回false
exit function '跳出过程
end if
for each name in names 'for each循环语句
if len(name)<=0 then 'len函数获得字符串的长度
chkemail=false '邮件格式错误,返回false
exit function '跳出过程
end if
next
end function '结束过程的定义
%>
<%
if request.form("submit")="确定" then '单击【确定】按钮
email=request.form("email") '读取输入的字符串
if chkemail(email) then '调用chkemail过程
response.write("") '提示格式错误
end if
end if
%>
邮箱验证代码二
<%
if request.form("submit")="确定" then '单击【确定】按钮
email=request.form("email") '读取输入的字符串
if chkemail(email) then '调用chkemail过程
response.write("") '提示格式错误
end if
end if
%>