%@ LANGUAGE = "VBScript" ENABLESESSIONSTATE = False %> <% OPTION EXPLICIT %> <% ' declare public variable(s) here DIM objRS DIM strSQL DIM sDate, sName, sEmail, sLocation, sMessage, strPath DIM iID ' *** Define your SQL query here strSQL = "SELECT * FROM log " & _ "WHERE active=TRUE " & _ "ORDER BY date DESC" function StripHTML(ByVal strContent) ' If the content is empty, exit the function now. if strContent = "" then exit function ' Create Regular Expression object. dim objRE set objRE = new RegExp ' Keep finding links after the first one. objRE.Global = True ' Set the regular expressions to be case-INsensitive. objRE.IgnoreCase = True ' Assign the regexp pattern. objRE.Pattern = "<[^>]+>" ' Replace the tags with an empty string. strContent = objRE.Replace(strContent, "") ' Release regular expression object. set objRE = Nothing StripHTML = strContent end function %>
|
||||
| Home | Family Tree | Messages | Biographies | Research | Guestbook | About | ||||
|
|
||||
|
Click here to leave a greeting to all of our family! <% ' Open the database and execute the SQL statement DSNOpen("HanifinGuestbook") SET objRS = objDB.Execute(strSQL) ' *** If the Query returned Records, Display the directory. ' otherwise display an error message if objRS.eof then response.write "ERROR: No Records were found..." else Do while NOT objRS.EOF iID = objRS("id") sDate = FormatDateTime(objRS("date"),1) sName = objRS("name") sEmail = objRS("email") sLocation = objRS("location") sMessage = objRS("message") if sMessage <> "" then sMessage = StripHTML(sMessage) 'If Trim(sMessage) = "" Then sMessage = "<No message>" response.write "
Message" &vbCrLf response.write sMessage &vbCrLf end if response.write "" & sDate &vbCrLf response.write " " &vbCrLf objRS.MoveNext Loop end if ' Free the resources by destroying the recordset object and closing the database SET objRS = nothing DBClose %> |
||||
| Leave a greeting. | Read everyones greetings. | ||||