<% fp = Server.MapPath("aspcount.txt") set fs= Server.CreateObject("Scripting.FileSystemObject") Set a = fs.OpenTextFile(fp) ct = Clng(a.ReadLine) if Session("ct") = "" then Session("ct") = ct ct = ct + 1 a.close Set a = fs.CreateTextFile(fp,True) a.WriteLine(ct) end if a.Close variable = ct %> document.write("<%=variable%>");