hit counter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shashikala
    New Member
    • Aug 2013
    • 12

    hit counter

    i am trying to make a hit counter that displays that how many times a page has been visited. the code is given below and is not working. any suggestions for the corrections?

    Code:
    <%
    Set FS=Server.CreateObject("Scripting.FileSystemObject")
    Set RS=FS.OpenTextFile(Server.MapPath("array.asp"), 1, False)
    fcount=RS.ReadLine
    RS.Close
    fcount=fcount+1
    Set RS=FS.OpenTextFile(Server.MapPath("array.asp"), 2, False)
    RS.Write fcount
    RS.Close
    
    Set RS=Nothing
    Set FS=Nothing
    
    %>
    <html>
    <body>
    <p>
    This page has been visited <%=fcount%>  times.
    </p>
    </body>
    </html>
    error:
    An error occurred on the server when processing the URL. Please contact the system administrator.
    If you are the system administrator please click here to find out more about this error.
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    I dont know much about ASP, but has the webserver rights to create a file called "array.asp" ?

    And, if you are the admin did you click here? ("If you are the system administrator please click here to find out more about this error. ")
    That should give a hint about what went wrong.....

    Comment

    • shashikala
      New Member
      • Aug 2013
      • 12

      #3
      Luuk,
      webserver does not create the file "array.asp" .
      It already exists. I just want to know that how much time this file has been visited.

      Comment

      • Luuk
        Recognized Expert Top Contributor
        • Mar 2012
        • 1043

        #4
        i said: "I dont know much about ASP, but has the webserver rights to create a file called "array.asp" ?"

        but let me change that to: "has the webserver rights to modify the file called "array.asp" ?

        Comment

        Working...