Function outHTML(str)
Dim sTemp
sTemp = str
outHTML = ""
If IsNull(sTemp) = True Then
Exit Function
End If
sTemp = Replace(sTemp, "&", "&")
sTemp = Replace(sTemp, "<", "<")
sTemp = Replace(sTemp, ">", ">")
sTemp = Replace(sTemp, Chr(34), """)
sTemp = Replace(sTemp, Chr(10), "<br>")
outHTML = sTemp
End Function
在添加记录的时候把留言信息用上边的过程处理一下
如:
set rs = server.createobject("adodb.recordset")
sql = "select * from tab"
rs.open sql,conn,1,3
rs.addnew
rs.("
留言信息字段")=outHTML(
这里是用户的留言如:request.form("text"))rs.update
rs.close
set rs = nothing
这样够明白了吧。。