|
Use this function to format content when adding content to the database:
Function Format(formatdata)
formatdata=replace(formatdata,"&","&")
'formatdata=replace(formatdata,"'","''")
formatdata=replace(formatdata,"<","<")
formatdata=replace(formatdata,">",">")
formatdata=replace(formatdata,"chr(60)","<")
formatdata=replace(formatdata,"chr(37)",">")
formatdata=replace(formatdata,"""",""")
'formatdata=replace(formatdata,";",";;")
formatdata=replace(formatdata,chr(13),"<br>"&chr(13)+chr(10))
format=replace(formatdata,chr(32)," ")
End Function
------------------------
When reading data, use the following function to restore the original input content:
Function UFormat(formatdata)
'formatdata=replace(formatdata,"&","&")
'formatdata=replace(formatdata,"''","'")
formatdata=replace(formatdata,"<","<")
formatdata=replace(formatdata,">",">")
formatdata=replace(formatdata,"<","chr(60)")
formatdata=replace(formatdata,">","chr(37)")
formatdata=replace(formatdata,""","""")
'formatdata=replace(formatdata,";;",";")
formatdata=replace(formatdata,"<br>"&chr(13)+chr(10),chr(13))
Uformat=replace(formatdata," ",chr(32))
End Function |
|