Page Counter By Shankar

<% function PageVisitCount() { var fso, f, ts, s; var ForReading = 1, ForWriting = 2, ForAppending = 8; var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0; fso = Server.CreateObject("Scripting.FileSystemObject"); var filename = Server.MapPath("SiteVisit.count"); f = fso.OpenTextFile(filename,ForReading,true,TristateUseDefault); var no = 1; var name; if( !f.AtEndOfStream ){ name = f.ReadLine(); no = parseInt(name); no++; } f.Close(); f = fso.OpenTextFile(filename,ForWriting,true,TristateUseDefault); f.WriteLine( no ); f.Close( ); // remove the following line if you do not want to display Response.write( 'This Page has been visited '+no+' Times' ); } PageVisitCount(); %>



Hit Refresh(F5) To see the above count increase.

This is a simple way To Keep Count Of Your Page Visits.
No MESSY Graphical Digits
Uses Javascript with ASP
Asp will work only when loaded from server

THIS CODE WILL NOT WORK IN UNIX SERVERS
WILL WORK ONLY IN WINDOWS SERVERS
Find out if your website is hosted in unix or windows server.

If there are any errors or if doesn't work please forgive me.
(You can see that this program is working at my website 6fix.com
by typing 6fix.com/pagecount.asp)

If you use it please visit my website www.6fix.com
If you are Moving, you can leave FORWARDING ADDRESS at 6fix.com for FREE.
Please visit 6fix.com to place FREE advertisement about
Jobs,Matrimonial,Vehicles, Used And Second Hand Items
Real Estate, Buying or Selling or Renting or Checking Property,
and please forward this message to all your friends.

Civilization is not a running race but a relay race,
I have downloaded and used innumerable
freeware software, and this is a very very small return for that
Those who use this should one day vow to pass it on by giving away
something else free to this world

(L) CopyLEFT 2001 G.Shankaranarayanan.
Anyone is free to use or modify or do anything else with this code
shankar@clenosindia.com

Advertising