如何判断URL格式是否符合规范?

%dim emailemail=request.form(email)if IsValidEmail(email) then if
request(action)=退订 then response.redirect del_email.asp?email=email
else response.redirect add_email.asp?email=email end ifelse
‘response.write 无效的电子邮件格式,请按后退开关,重填二个可行的Email
response.writeSC讴歌ZDXIPT
language=JavaScriptalert(‘无效的电子邮件格式,请重填三个卓有效用的Email!’卡塔尔国;
response.writejavascript:history.go(-1卡塔尔/SCHavalIPTend iffunction
IsValidEmail(email卡塔尔(قطر‎dim names, name, i, c’Check for valid syntax in an
email address.IsValidEmail = truenames = Split(email, @卡塔尔if UBound(names卡塔尔国1 then IsValidEmail = false exit functionend iffor 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卡塔尔State of Qatar 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 ifnextif
InStr(names(1), .) = 0 then IsValidEmail = false exit functionend ifi =
Len(names(1)) – InStrRev(names(1), .)if i 2 and i 3 then IsValidEmail =
false exit functionend ifif InStr(email, ..) 0 then IsValidEmail =
falseend ifend function%

%function checkisUrl(tmpString) dim c,i checkisUrl = true
tmpString=Lcase(trim(tmpString)) if left(tmpString,7)”” then
tmpString=””&tmpString for i = 8 to Len(checkisUrl) c =
Lcase(Mid(tmpString, i, 1)) if InStr(“abcdefghijklmnopqrstuvwxyz_-.//”,
c) = 0 and not IsNumeric(c) then checkisUrl = false exit function end if
next if Left(tmpString, 1) = “.” or Right(tmpString, 1) = “.” then
checkisUrl = false exit function end if if InStr(tmpString, “.”) = 0
then checkisUrl = false response.Write “f3” exit function end if if
InStr(checkisUrl, “..”) 0 then checkisUrl = false end ifend function%%if
checkisUrl(request(“u”))=true then %恭喜,你的URL通过!%else
%抱歉,你的UENCOREL不合乎标准,请重新检查!%end if%

复制代码 代码如下:

[1]

<!–#include file=”conn.asp”–>
澳门新葡萄京娱乐场 ,<!–#include file=”KS_Cls/KS.PublicCls.asp”–>
<%
‘=============================================
‘KesionCMSV4.0 个人空间二级域名转向管理程序
‘=============================================
‘****************************************************
‘ Software name:Kesion CMS 4.0
‘ Email: service@kesion.com . QQ:111394,9537636
‘ Web:  
‘ Copyright (C) Kesion Network All Rights Reserved.
‘****************************************************
Dim KSCls
Set KSCls = New SiteIndex
KSCls.Kesion()
Set KSCls = Nothing

Class SiteIndex
        Private KS
        Private From,gourl,sdomain,title,username
        Private Sub Class_Initialize()
         If (Not Response.IsClientConnected)Then
            Response.Clear
            Response.End
         End If
          Set KS=New PublicCls
        End Sub
        Private Sub Class_Terminate()
         Call CloseConn()
         Set KS=Nothing
        End Sub
        Public Sub Kesion()
        From = LCase(Request.ServerVariables(“HTTP_HOST”))
        sdomain = LCase(KS.SSetting(15))
        sdomain = Replace(sdomain,”http://”,””)
        sdomain = Replace(sdomain,”/”,””)

        
        dim domain1,domain2
            domain = LCase (from)
            domain = Replace (domain,”http://”,””)
            domain = Replace (domain,”/”,””)

            if sdomain=domain and sdomain<>”” then
              title=KS.Setting(1State of Qatar & “-个人空间” 
              gourl=”space/index.asp”
            else
             domain1= Replace (Left (domain,InStr (domain,”.”)),”.”,””)
             if Trim (domain1)=”” or domain1=”www” Then Response.Redirect(“index.asp”):Response.End
             dim rs:set rs=conn.execute(“select username,blogname from ks_blog where [domain]='” & KS.R(domain1) & “‘”)
             if rs.eof and rs.bof then
              rs.close:set rs=nothing

              
              ‘=====================这里定义别的系统非个人空间的二级域名转向,如论坛等=============================
              if instr(Request.ServerVariables(“SERVER_NAME”),”bbs.kesion.com”)>0 then
                 response.redirect “bbs/index.asp”
              elseif instr(Request.ServerVariables(“SERVER_NAME”),”news.kesion.com”)>0 then
                 response.redirect “news/”
              elseif instr(Request.ServerVariables(“SERVER_NAME”),”help.kesion.com”)>0 then
                 response.redirect “help/”
              else
               response.redirect “index.asp”
              end if
             ‘============================================================================

              exit sub
             end if
             title=rs(“blogname”)
             domain1=rs(“username”)
             rs.close:set rs=nothing

             domain2= Right(domain,Len(domain)-InStr(domain,”.”))
             gourl=”space/space.asp?username=” & domain1
            end if

           Response.Write (“<html>”) & vbcrlf
           Response.Write (“<meta http-equiv=””Content-Type”” content=””text/html; charset=gb2312″” />”) & vbcrlf
           Response.Write (“<title>” & title & “</title>”) & vbcrlf
           Response.Write (“<head>”) & vbcrlf
           Response.Write (“</head>”) & vbcrlf
           Response.Write( “<frameset><frame src=”””&gourl&”””></frameset>”)
         End Sub
End Class
%>

您只怕感兴趣的篇章:

  • 多域名绑定到三个空中访谈分化首页的技巧
  • 同一空间绑定多个域名而实现访谈区别页面包车型大巴PHP代码
  • asp下同一空间多绑多哥域名的办法
  • 新学到的一招之单空间绑多域名达成提速
  • 八个或七个域名共用三个空间并得以单独访谈的不二等秘书籍
  • 可绑定域名的德意志10GB无偿PHP空间
  • .htaccess
    拔尖域名重定向绑定空间引得
  • 何以将javaweb项目配置到linux下
  • SSH框架英特网商铺项目第19战之订单消息级联入库以至页面缓存问题
  • SSH框架英特网百货店项目第27战之申请域名空间和种类配置及公布

发表评论

电子邮件地址不会被公开。 必填项已用*标注