<% Set fs = CreateObject("Scripting.FileSystemObject") Folderpath=server.mappath("\") & "/cgi-bin/mivzak" Wcounter=Folderpath &"/counter.txt" if request.form<>"" 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 Function TransformDate(datesource) if datepart("d",datesource)<10 then datesourceday="0" & datepart("d",datesource) else datesourceday="" & datepart("d",datesource) end if if datepart("m",datesource)<10 then datesourcemonth="0" & datepart("m",datesource) else datesourcemonth="" & datepart("m",datesource) end if datesourceyear=datepart("yyyy",datesource) TransformDate = datesourceday & "/" & datesourcemonth & "/" & datesourceyear End Function varDate = Now() Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile(Folderpath & "\" & counter & ".txt") a.WriteLine("") a.WriteLine(TransformDate(Date)) a.WriteLine(" ") a.WriteLine(FormatDateTime(varDate, 3)) a.WriteLine("
") a.WriteLine("") a.WriteLine(Replace(Request.Form("visitorsmessage"), CHR(13), "
")) a.WriteLine("
") a.WriteLine("
") a.WriteLine("") a.WriteLine("מאת:") a.WriteLine(Request.Form("visitorsname")) a.WriteLine(",") a.WriteLine(Request.Form("city")) a.Close Set a=nothing Set fs=nothing 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 "
" & vbCrLf For Each f1 in fc Wfile=f1.name if Wfile<>"counter.txt" then FiletoCheck=Folderpath & "/" & Wfile Set a=fs.OpenTextFile(FiletoCheck) 'Theinfo=a.ReadAll ' Response.write("
" & Theinfo & "

") 'end if 'Next 'to show last message in the top, 'remove previous 4 lines and write next 4 lines instead Theinfo= a.ReadAll & "
" & Theinfo end if Next Response.write(Theinfo) Response.Write ("") %>