Function outhtml (str)
dim stemp
stemp = str
outhtml = "
if IsNull (stemp) = Tru E Then
exit Function
end If
stemp = Replace (Stemp, "&", "&")
stemp = Replace (Stemp, "<", "<")
stemp = Replace (stemp, ">", ">")
stemp = Replace (Stemp, Chr (), ")
stemp = Replace (Stemp, Chr (), <br>)
outhtml = stemp
End Function
' ============================================
' removes the HTML format for fetching values from the database when filling in the input box
' NOTE: value= '? This way, be sure to use double quotes
' ============================================
Function inhtml (str)
dim stemp
stemp = str
inhtml = ""
if IsNull (stemp) = True Then
exit Function
end if
stemp = Replace (Stemp, "&", "&")
stemp = Replace (Stemp, "<", "<")
stemp = Replace (stemp, ">", ">")
stemp = Replace (Stemp, Chr (), ")
inhtml = stemp
End Function
' ============================================
' Detect if the page is submitted from this site
' Back: True,false
' ============================================
Function Isselfrefer ()
Dim Shttp_referer, Sserver_name
Shttp_referer = CStr (Request.ServerVariables ("Http_referer"))
Sserver_name = CStr (Request.ServerVariables ("SERVER_NAME"))
If Mid (Shttp_referer, 8, Len (sserver_name)) = Sserver_name Then
Isselfrefer = True
Else
Isselfrefer = False
End If
End Function
' ============================================
' Get a secure string to use in a query
' ============================================
Function get_safestr (str)
GET_SAFESTR = replace (replace (Trim (str), "'", ""), Chr (34), ""), ";"
End Function
' ============================================
' takes the actual character length
' ============================================
Function Get_truelen (str)
dim L, T, C, I
l = Len (str)
t = L
for i = 1 to l
&N Bsp; c = ASC (Mid (str, I, 1))
if C < 0 Then C = c + 65536
if C > 255 Then t = t + 1
next
get_truelen = t
End Function
' ============================================
' To determine if a secure string is used in special fields such as registration login
' ============================================
Function issafestr (str)
Dim s_badstr, N, I
S_badstr = "' &<>?%,;:() ' ~!@#$^*{}[]|+-= ' & Chr (+) & Chr (9) & Chr (32)
n = Len (S_BADSTR)
Issafestr = True
For i = 1 to n
If Instr (str, Mid (S_BADSTR, I, 1)) > 0 Then
Issafestr = False
Exit Function
End If
Next
End Function