<% Set fs = CreateObject("Scripting.FileSystemObject") Folderpath=server.mappath("\") & "/cgi-bin/guestbook" Wcounter=Folderpath &"/counter.txt" if request.form<>"" then Wemail = Request.Form("visitorsemail") test1=instr(Wemail, "@") ' value must be >1 test2=instr(Wemail, ".") ' value must be >4 test3=len(Wemail) ' value must be >6 test4=InStr (test1,Wemail,".",1) ' value must be >test1+2 if test1<2 OR test2<5 OR test3<7 OR test4") email_Test=0 else email_Test=1 end if if email_Test=1 then Set fs = CreateObject("Scripting.FileSystemObject") if fs.FolderExists(Folderpath) then Set a = fs.OpenTextFile(Wcounter) counter = Clng(a.ReadLine) counter = counter + 1 a.close else Set a = fs.CreateFolder(Folderpath) counter=1 end if Set a = fs.CreateTextFile(Wcounter,True) a.WriteLine(counter) a.Close Set fs=nothing Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile(Folderpath & "\" & counter & ".txt") a.WriteLine("" & Request.Form("visitorsname") & "") a.WriteLine(Request.Form("visitorsmessage")) a.Close Set a=nothing Set fs=nothing end if end if Dim fs, f, f1, fc, s Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder(Folderpath) Set fc = f.Files Response.Write ("Guest book") Response.Write ("") Response.Write ("") Response.Write ("
") Response.Write ("Guest book: posted messages") Response.Write ("
") For Each f1 in fc Wfile=f1.name if Wfile<>"counter.txt" then FiletoCheck=Folderpath & "/" & Wfile Set a=fs.OpenTextFile(FiletoCheck) Theinfo="
" &a.ReadAll & "

" & Theinfo end if Next Response.write(Theinfo) Response.write("
Script provided by asptutorial.info
") Response.Write ("") %>