-
November 22nd, 2001, 03:18 AM
#1
Counter using Dreamweaver for intranet
Does anyone know how to create a counter with Dreamweaver (4) for use within an intranet? I know Frontpage can create one but don't know how to do it with Dreamweaver.
-
December 4th, 2001, 03:17 AM
#2
Registered User
You need to have a cgi script for it in the cgi-bin folder. Usually the webhost will provide this for you. Then you need a line in the body of the html to run the cgi script. Hopefully the example below will show up in this post (use the font tags properly. Below I used parenthesis just so it would show up in this post.)
(font)You are visitor #< !--#exec cgi="/cgi-bin/counter"-->(/font)
-
December 4th, 2001, 03:47 AM
#3
-
December 4th, 2001, 01:34 PM
#4
Here is a link that will explain to you in detail how it works, how to integrate it, etc.
<a href="http://worldwidemart.com/scripts/counter.shtml" target="_blank">http://worldwidemart.com/scripts/counter.shtml</a>
Matt's Scripts are used everywhere, including some hosting companies. Hope it helps.
The objective it is not to die for your country, but to make the other bastard die for his.
-
December 5th, 2001, 04:25 AM
#5
Thanks for the info, it sure helps.
-
December 5th, 2001, 05:02 AM
#6
Or if using a host that allows asp just put code like this
[code]
dim OutStream, OldHits, NewHits
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
HitsFile = Server.MapPath ("counter") & "\hits.txt"
Set InStream= FileObject.OpenTextFile (HitsFile, 1, false )
OldHits = Trim(InStream.ReadLine)
NewHits = OldHits + 1
Set OutStream= FileObject.CreateTextFile (HitsFile, True)
OutStream.WriteLine(NewHits)
set FileObject = NOTHING
OutStream.Close
set OutStream = NOTHING</pre><hr></blockquote>
at the top of your page then where ever you want to put your counter just place a response.write for the varible NewHits. Then all you need is a file with anon usr read and write privlidges.
Of course it does not prevent a refresh of the page from adding one to the counter. But it would not be that hard to prevent that. Just use response.servervarible to record the ip and anyone that access the site, record it to a text file with a timestamp. Compare the ip and if the time is a different day with any new access and you will only record each unique ip once a day.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks