Results 1 to 3 of 3

Thread: Hit Counter

  1. #1
    Join Date
    Oct 2012
    Location
    England
    Posts
    98
    Thanks
    27
    Thanked 2 Times in 1 Post

    Default Hit Counter

    Hi, again I've been asked to modify the school website and one of the things they've asked for is a Hit Counter.

    I've found some free ones online and they seem to be doing the trick but they do have an advert to their webpage which isn't too much of a problem but I'd prefer one that's just ours and not linked to another site.

    I've done some research and found one Javascript based Hit Counter which worked in Dreamweaver but when I put it online it didn't work.

    Anyone know of a simple code I can just import into a webpage or are the free ones online the best and easiest option?

    Thanks,



    Jay Dog

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,069
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    If the school's website's host has server side code like PHP available, a simple hit counter could be made that would update a file with a number. That number could be private for your viewing only or could be shown on the page. What hits are you counting? The number of people who land on the home page? Something else?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    JS alone can't do this: that'll just save the information locally (based on you viewing the website). In fact, that's an odd idea in the first place (so I'm not sure why DW includes it). As John said, this can be done relatively easily.

    If you don't have PHP (or another serverside language) there is a way around this, which is by using an image that is generated dynamically and tracks how many times the image [not the page] is loaded. That's probably what the scripts you've already seen do; you could do the same (but of course you'd need a second server with a serverside language like PHP for that to work).

    "hit counter" is such a common thing that you can keep looking and you'll probably find some without ads. I imagine there are thousands out there (just the free ones). It might not look exactly like you want, in which case you'd want to switch to something you can control (with a serverside language like PHP). Note that some free ones will work with serverside languages too. You could start here for example:
    https://www.google.com/search?q=php+hit+counter
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Similar Threads

  1. counter
    By benslayton in forum JavaScript
    Replies: 1
    Last Post: 06-25-2006, 04:45 AM
  2. counter
    By tour93 in forum PHP
    Replies: 1
    Last Post: 05-21-2006, 07:57 PM
  3. Need help with a hit counter
    By don biltcliffe in forum HTML
    Replies: 2
    Last Post: 11-04-2004, 06:06 AM
  4. Automatic counter code (not page counter)
    By OxfordDon in forum JavaScript
    Replies: 1
    Last Post: 11-03-2004, 02:12 PM

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
  •