Morpheusweb.it - Risorse per webmaster: script, ASP.NET, C#, Visual Basic .Net, tutorial, asp, javascript, css, php, html, java, ADO, VBScript, forms, frames, Active Server Pages, Dynamic HTML, database, gratis per webmaster e webdesigner

Counter with file

Click counter on a determined link.
It memorizes the information on the clicks in a text file.


<a href="contaclick.asp?code=counter&url=http://www.link_alla_pagina.com">Click here </a>
<%
MyFile = Server.MapPath( Request.Querystring ("coe") &".txt" )
'write data in counter.txt file
Set FileObject = CreateObject("Scripting.FileSystemObject")
on error resume next
Set InStream = FileObject.OpenTextFile(MyFile, 1, true)
totali = CInt(Instream.ReadLine) + 1
Instream.Close
set instream = Nothing
Set OutStream = FileObject.OpenTextFile(MyFile, 2, true)
Outstream.WriteLine totali
Outstream.Close
Set OutStream = Nothing
set FileObject = Nothing
Response.Redirect ( Request.QueryString("url") )
%>


Download code...


Print this page


 

Inizio pagina

risorse per webmaster