Here's a click-thru counter you can use to count how many times a
link and/or graphic has been clicked. What you need are three things:
Here's the code:
<% Set FileObject = Server.CreateObject("Scripting.FileSystemObject") HitsFile = Server.MapPath ("/counter") & "\click_hits.txt" Set InStream= FileObject.OpenTextFile (HitsFile, 1, false ) Oldclick_hits = Trim(InStream.ReadLine) Newclick_hits = OldClick_hits + 1 Set OutStream= FileObject.CreateTextFile (HitsFile, True) OutStream.WriteLine(NewClick_hits) %>
<% Response.Buffer = True%> <!--#include file="click_counter.asp"--> <% Response.Redirect "http://www.example.com" %>
Instead of having <a
href="http://www.example.com">
use
<a
href="www.example.com/count_redirect.asp">Click Here</a>
click through counting advertising clicks counter hits visits hitcount