<% dim sPage sPage = "home" %> <% function counter(pageName) 'Simple asp page counter by Barry Wright 'Using the File System Object 'Create the FSO Set bwoFSO = Server.CreateObject("Scripting.FileSystemObject") 'Location of text file to store page count. sTextPath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "redesign/includes/" & pageName & ".txt" sTextPath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "includes/" & pageName & ".txt" Set bwoFile = bwoFSO.OpenTextFile(sTextPath) 'now we read the number in the file oldNum = CLng(bwoFile.ReadLine) 'and we close bwoFile.Close 'we add one to the number newNum = oldNum + 1 'we open the file to overwrite the new number to it Set bwoFile = bwoFSO.OpenTextFile(sTextPath,2,true) 'and we overwrite it here bwoFile.WriteLine(newNum) 'and we close the file again bwoFile.Close 'now we use the number for our display strCount = newNum ' newNum = "AAAA" counter = newNum end function %> Alex North Music: Home