Copy Code code as follows:
function HTMLEncode (fstring)
If not IsNull (fstring) Then
fstring = replace (fstring, ">", ">")
fstring = replace (fstring, "<", "<")
fstring = Replace (fstring, CHR (32), "")
fstring = Replace (fstring, CHR (9), "")
fstring = Replace (fstring, CHR (34), "" ")
fstring = Replace (fstring, CHR (39), "'")
fstring = Replace (fstring, CHR (13), "")
fstring = Replace (fstring, CHR (a) & CHR (a), "</P><P>")
fstring = Replace (fstring, CHR (), "<BR>")
HTMLEncode = fstring
End If
End Function
function Safe (str) ' It is used to determine whether a variable passed over contains special characters and does not return true
Dim s_badstr, N, I
S_badstr = "' &<>?%,;:() ' ~!@#$^*{}[]|\/+-= ' &CHR (&CHR) (9) &CHR (32)
n = Len (S_BADSTR)
Safe = True
For i = 1 to n
If Instr (str, Mid (S_BADSTR, I, 1)) > 0 Then
Safe = False
Exit Function
End If
Next
End Function