By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,162 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,162 IT Pros & Developers. It's quick & easy.

hit counter

P: 12
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?

Expand|Select|Wrap|Line Numbers
  1. <%
  2. Set FS=Server.CreateObject("Scripting.FileSystemObject")
  3. Set RS=FS.OpenTextFile(Server.MapPath("array.asp"), 1, False)
  4. fcount=RS.ReadLine
  5. RS.Close
  6. fcount=fcount+1
  7. Set RS=FS.OpenTextFile(Server.MapPath("array.asp"), 2, False)
  8. RS.Write fcount
  9. RS.Close
  10.  
  11. Set RS=Nothing
  12. Set FS=Nothing
  13.  
  14. %>
  15. <html>
  16. <body>
  17. <p>
  18. This page has been visited <%=fcount%>  times.
  19. </p>
  20. </body>
  21. </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.
Nov 10 '13 #1
Share this Question
Share on Google+
3 Replies


Expert 100+
P: 1,035
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.....
Nov 10 '13 #2

P: 12
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.
Nov 11 '13 #3

Expert 100+
P: 1,035
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"?
Nov 11 '13 #4

Post your reply

Sign in to post your reply or Sign up for a free account.