⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mycheck.asp

📁 超级留言簿(dxxo) 本留言参考了网上很多留言簿改进而来
💻 ASP
字号:
<%
'是否是整数
  function isInteger(para)
       on error resume next
       dim str
       dim l,i
       if isNUll(para) then 
          isInteger=false
          exit function
       end if
       str=cstr(para)
       if trim(str)="" then
          isInteger=false
          exit function
       end if
       l=len(str)
       for i=1 to l
           if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
              isInteger=false 
              exit function
           end if
       next
       isInteger=true
       if err.number<>0 then err.clear
   end function
%>
<%
'用来形成具有日期的编号
  timenow=now()
  daynow=day(timenow)
  monthnow=month(timenow)
  hournow=hour(timenow)
  minutenow=minute(timenow)
  secondnow=second(timenow)
 if  day(timenow)<10 then
    daynow="0"&day(timenow)
 end if
 if  month(timenow)<10 then
     monthnow="0"&month(timenow)
 end if
 if  hour(timenow)<10 then
     hournow="0"&hour(timenow)
 end if
 if  minute(timenow)<10 then
     minutenow="0"&minute(timenow)
 end if
 if  second(timenow)<10 then
     secondnow="0"&second(timenow)
 end if
 dateID=year(timenow)&monthnow&daynow&hournow&minutenow&secondnow
'   response.write DateID
%>
<%
'检查电子邮件是否正确
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
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -