<% Sub ReadGuestBook Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(Server.MapPath("guestbook-data.txt")) Do Until objFile.AtEndOfStream strGuestbook = strGuestbook & objFile.ReadLine Loop 'strGuestbook = objFile.ReadAll Set objFile = Nothing IF Request("action") = "sign" Then IF Trim(Request.Form("name")) <> "" AND Trim(Request.Form("msg")) <> "" AND IsNotFilth(LCase(Trim(Request.Form("name"))),LCase(Trim(Request.Form("msg")))) Then 'add new entry strGuestbook = Trim(Request.Form("name")) & Chr(9) & Day(Date) & " " & MonthName(Month(Date),1) & " " & Year(Date) & Chr(9) & Trim(Request.Form("msg")) & vbcrlf & strGuestbook Set objFile = objFSO.CreateTextFile(Server.MapPath("guestbook-data.txt")) objFile.Write strGuestbook Set objFile = Nothing strMsg = "

Thank You. Your message was added.

" Else strMsg = "

Please Enter your Name AND Message.

" End IF End IF Response.Write strMsg & vbcrlf IF Trim(strGuestbook) <> "" Then arrList = Split(strGuestbook,vbcrlf) For I = 0 To UBound(arrList) IF Trim(arrList(I)) <> "" Then arrEntry = Split(arrList(I),Chr(9)) strName = arrEntry(0) strDate = arrEntry(1) strMsg = arrEntry(2) Response.Write "" & strName & " - " & strDate & "
" & vbcrlf Response.Write strMsg IF Request("SDKDGJK") = "DFSLKJGDGKBFKDBJFKBJ" Then 'allow deletion Response.Write "
DELETE" & vbcrlf IF (Request("delete") <> "") AND (Int(Request("delete")) <> I) Then strNewGuestBook = strNewGuestBook & arrList(I) & vbcrlf End IF End IF Response.Write "
" & vbcrlf End IF Next End IF IF (Request("SDKDGJK") = "DFSLKJGDGKBFKDBJFKBJ") AND (Request("delete") <> "") Then 'write updated guestbook Set objFile = objFSO.CreateTextFile(Server.MapPath("guestbook-data.txt")) objFile.Write strNewGuestBook Set objFile = Nothing Set objFSO = Nothing Response.Redirect "guestbook.asp?SDKDGJK=DFSLKJGDGKBFKDBJFKBJ" End IF Set objFSO = Nothing End Sub Function IsNotFilth(strName,strMsg) IsNotFilth = True Dim arrFilth(9) arrFilth(0) = "fuck" arrFilth(1) = "shit" arrFilth(2) = "shite" arrFilth(3) = "cunt" arrFilth(4) = "dick" arrFilth(5) = "bastard" arrFilth(6) = "tits" arrFilth(7) = "cock" arrFilth(8) = "f u c k" arrFilth(9) = "s h i t" For I = 0 To 9 IF InStr(strName,arrFilth(I)) OR InStr(strMsg,arrFilth(I)) Then IsNotFilth = False Exit For End IF Next End Function %> Guestbook
Doh Ray Music - Elizabeth Pritchard Home
Singing LessonsPiano LessonsMusic Theory Lessons
WeddingsRememberance ServicesRecitals, Concert & Other Events
Audio SamplesShop
Contact Us

Guestbook

<% ReadGuestbook %>
Sign the Guestbook
Name
Message