How to use the number of clicks in HTML
<a href=counter.asp?save=123&url=http://127.0.0.1/>http://127.0.0.1</a>
Total Hits: <script src=view.asp?save=123></script>
Counter.asp
*************************
<%
Path= "D:\data\"
File=request ("Save")
Url=request ("url")
Set fs = CreateObject ("Scripting.FileSystemObject")
If Fs. FileExists (Path & File & ". txt") Then
Set thisfile = fs. OpenTextFile (Path & File & ". txt", 1, False)
Number=thisfile.readline + 1
Thisfile. Close
Set Outfile=fs. CreateTextFile (Path & File & ". txt")
OutFile. WriteLine number
Outfile.close
Set fs=nothing
Else
Number=1
Set Outfile=fs. CreateTextFile (Path & File & ". txt")
OutFile. WriteLine number
Outfile.close
Set fs=nothing
End If
Response.Redirect URL
%>
View.asp
***************************
<%
Path= "D:\data\"
File=request ("Save")
Set fs = CreateObject ("Scripting.FileSystemObject")
If Fs. FileExists (Path & File & ". txt") Then
Set thisfile = fs. OpenTextFile (Path & File & ". txt", 1, False)
Number=thisfile.readline
Thisfile. Close
Set fs=nothing
Else
Number=0
End If
Response.ContentType = "Application/x-javascript"
Response.Write "document.write (" "" & Number & ""); "
%>