hey there. im new to the coding side of asp as i learnt html before hand. What im trying to do is intergreat a smilie filter in to a small chat i building for me and and some mates. The chat is using a SQL database and IIS. my current source code for it is here:
I want to post the smiles where the <%=(chatmsg.Fie lds.Item("TBLme ssage").Value)% > is as this displays the message. Any ideas how i go about doing this as the chat does not have any filter yet. thanks in advance.
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!--#include file="../../../../Connections/databasechat.asp" --> <% Dim chatmsg__MMColParam chatmsg__MMColParam = "3" If (Request("MM_EmptyValue") <> "") Then chatmsg__MMColParam = Request("MM_EmptyValue") End If %> <% Dim chatmsg Dim chatmsg_numRows Set chatmsg = Server.CreateObject("ADODB.Recordset") chatmsg.ActiveConnection = MM_databasechat_STRING chatmsg.Source = "SELECT * FROM dbo.TBLmainroom WHERE TBLroom = '" + Replace(chatmsg__MMColParam, "'", "''") + "' ORDER BY ID DESC" chatmsg.CursorType = 0 chatmsg.CursorLocation = 2 chatmsg.LockType = 1 chatmsg.Open() chatmsg_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = 100 Repeat1__index = 0 chatmsg_numRows = chatmsg_numRows + Repeat1__numRows %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <%Response.Expires=-1%> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script> <!-- function timedRefresh(timeoutPeriod) { setTimeout("location.reload(true);",timeoutPeriod); } // --> </script> <title>Untitled Document</title> <style type="text/css"> <!-- body { margin: 0px 0px 0px 0px; .style2 {color: #0000FF} .style3 { font-size: 9px; font-family: Arial, Helvetica, sans-serif; } .style6 {color: #FF00FF} .style7 {font-family: Arial, Helvetica, sans-serif} .style8 { color: #FFFFFF; font-style: italic; } .style10 { font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-style: italic; color: #FF00FF; } --> </style> </head> <body onload="JavaScript:timedRefresh(3000);"> <% If Not chatmsg.EOF Or Not chatmsg.BOF Then %> <% While ((Repeat1__numRows <> 0) AND (NOT chatmsg.EOF)) %> <strong><span class="style7"><font color="#00FF00"><%=(chatmsg.Fields.Item("TBLuser").Value)%></font></span></span> </strong><span class="style7"></span> <span class="style7"><font color="#9900FF"><%=(chatmsg.Fields.Item("TBLmessage").Value)%></font></span><br /> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 chatmsg.MoveNext() Wend %> <% End If ' end Not chatmsg.EOF Or NOT chatmsg.BOF %> </body> </html> <% chatmsg.Close() Set chatmsg = Nothing %>
Comment