| |
| |
<%
Function stripHTML(strHTML)
'Strips the HTML tags from strHTML
Dim objRegExp, strOutput
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<(.|\n)+?>"
'Replace all HTML tag matches with the empty string
strOutput = strHTML
'Replace all < and > with < and >
stripHTML = strOutput 'Return the value of strOutput
Set objRegExp = Nothing
End Function
Dim CnnObj
Dim strDataSource,strCnn
If Len(Trim(Session("Path")))=0 Then
Session("Path")= Server.MapPath("\")
End If
strDataSource = Session("Path")&"\htm\admin\database\kdvudb.mdb"
'response.write strDataSource
strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
strCnn = strCnn &strDataSource& ";"
Set CnnObj = Server.CreateObject("ADODB.Connection")
Cnnobj.Mode = 3
CnnObj.Open strCnn
Dim rsGuestBook,strQryGuestBook,intCount,strTable
Set rsGuestBook=Server.CreateObject("ADODB.Recordset")
strQryGuestBook="SELECT GuestID,GuestName,GuestDate,GuestAuthor,GuestContents ,GuestEMail,GuestDisplay FROM tblGuestBook where GuestDisplay='1' "
rsGuestBook.Open strQryGuestBook,CnnObj,0,3
If Not rsGuestBook.EOF Then
intCount=1
Do Until rsGuestBook.EOF
%>
| Topic: |
<%response.write(stripHTML(Trim(rsGuestBook("GuestAuthor"))))%> |
Date: |
<%response.write(Trim(stripHTML(rsGuestBook("GuestDate"))))%> |
| Name: |
<%response.write(stripHTML(rsGuestBook("GuestName")))%> |
Email: |
<% response.write(stripHTML(rsGuestBook("GuestEMail")))%> |
Comments |
<% response.write(stripHTML(Trim(rsGuestBook("GuestContents"))))%> |
<%
intCount=intCount+1
rsGuestBook.MoveNext
Loop
Else
End IF
rsGuestBook.Close
Set rsGuestBook=Nothing
%>
|
|