This example is a simple text based counter. I call it simple because it will only show page views, not actual visitors. It uses the File Scripting Object to interact with a text file. The first thing it does is read the current number in the file and add one to it, then displays it as text on the page.
True Type Fonts
Download thousands of free fonts.
Download Here.
Device Drivers
DirectX
VBrun Files
By Peripheral:


All Drivers
Dll Search
Download Dll Files
Enter The Dll Name:
Paco's Screensaver
Download The Official Paco's Drivers Screensaver.
Check It Out
Computer Maintenance
File Systems
Hardware
Over Clocking
Registry
Surf 2X Faster
Desktop Enhancements
Anime
Icons
Screensavers
Themes
Site Search:

Free Software
Anti-Virus
Audio Tools
E-Mail Clients
Firewalls
Graphic Editors
Web Development
ASP/VBScript
CGI Script
HTML
JavaScript
Paco's Own Scripts
Webmasters Tools
Were Listed @

Aspin.com

ScriptSearch.com

Simple Text Counter

We Have Had
29125
Total Page Views

<%
'here we set up a connection to the txt file using a physical path
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.OpenTextFile("C:\InetPub\wwwroot\counter\count.txt")

'now we read the number in the file
oldNum = CLng(oFile.ReadLine)

'and we close
oFile.Close

'we add one to the number
oldNum = oldNum + 1

'we open the file to overwrite the new number to it
Set oFile = oFSO.OpenTextFile("C:\InetPub\wwwroot\counter\count.txt",2,true)

'and we overwrite it here
oFile.WriteLine(oldNum)

'and we close the file again
oFile.Close

'now we use the number for our display
strCount = oldNum
%>

Below is a mix of html and vbscript. I will display the script in red to make it more discernable.

<div align="center">
<center>
<table border="0">
<tr>
<td width="100%" align="center">We Have Had</td>
</tr>
<tr>
<td width="100%" align="center"><%=strCount%></td>
</tr>
<tr>
<td width="100%" align="center">Total Page Views</td>
</tr>
</table>
</center>
</div>

That's really all there is to it. The only thing left to do is create a text file named count.txt and place it in a directory named counter. Add your numbers to the web and you're all set!

Search The Web Using Paco's MetaSearch
  
any   all   phrase
 About  Factmonster  AlltheWeb   
 MSN  Yahooligans      
Arts
Movies, Television, Music...
Business
Jobs, Industries, Investing...
Computers
Internet, Software, Hardware...
Games
Video Games, RPGs, Gambling...
Health
Fitness, Medicine, Alternative...
Home
Family, Consumers, Cooking...
Kids and Teens
Arts, School Time, Teen Life...
News
Media, Newspapers, Weather...
Recreation
Travel, Food, Outdoors, Humor...
Reference
Maps, Education, Libraries...
Regional
US, Canada, UK, Europe...
Science
Biology, Psychology, Physics...
Shopping
Autos, Clothing, Gifts...
Society
People, Religion, Issues...
Sports
Baseball, Soccer, Basketball...
World
Deutsch, Español, Français, Italiano, Japanese, Nederlands, Polska, Svenska...
Help build the largest human-edited directory of the web
Stop Popups
Paco's Popup Plucker.
Eliminate those pesky popups!
Users Online
Currently 96 users at PacosDrivers.com
Paco's Online

Send this page to a friend
Report Broken Links
Bad or missing query parameters in request.
Hosted By
ChamberGates

Privacy Policy
Best Viewed At 1024 X 768 Or Higher
Copyright © 2000-2008 Pacosdrivers.com. All Rights Reserved.