Counter using Dreamweaver for intranet
Results 1 to 6 of 6

Thread: Counter using Dreamweaver for intranet

  1. #1
    Registered User
    Join Date
    Aug 2000
    Posts
    193

    Question 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.

  2. #2
    Registered User WebHead's Avatar
    Join Date
    Oct 2000
    Posts
    8,208

    Post

    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)
    Hello World

  3. #3
    Registered User
    Join Date
    Aug 2000
    Posts
    193

    Thumbs up

    Thanks, I'll try it.

  4. #4
    Registered User
    Join Date
    Nov 2000
    Location
    Palm Beach, FL.
    Posts
    77

    Lightbulb

    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.

  5. #5
    Registered User
    Join Date
    Aug 2000
    Posts
    193

    Post

    Thanks for the info, it sure helps.

  6. #6
    Registered User
    Join Date
    Mar 1999
    Location
    The large sandbar north of Cuba
    Posts
    506

    Post

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •