Results 1 to 7 of 7
  1. #1
    Counter of sorts
    Graphite's Avatar
    Member Since
    Feb 25, 2003
    Location
    Tropical Island, Jealous?
    Posts
    5,279
    Specs:
    MacPro 3.0Ghz 16GB RAM, 4x256 Vid, 30''cinema display
    Arrow
    im not exactly an expert html coder, I only bothered learning enough to build a quality site.

    I am now wondering about a counter, I hate seeing counters on pages... but it may be the only way I can get an accurate # of visits to mysite.

    Anyone have a better way? Ide hate to clutter my site with a visible counter.

  2. #2
    Counter of sorts
    muso's Avatar
    Member Since
    Jan 15, 2003
    Location
    Whangarei, New Zealand
    Posts
    2
    Specs:
    Pwnt
    You can make a relatively easy invisible one with php. Do you know any php? I can't remember the code off the top of my head but I'll try find a tutorial for you.
    I'm in your forums, writing sentences in a grammatically acceptable manner.

  3. #3
    Counter of sorts
    Graphite's Avatar
    Member Since
    Feb 25, 2003
    Location
    Tropical Island, Jealous?
    Posts
    5,279
    Specs:
    MacPro 3.0Ghz 16GB RAM, 4x256 Vid, 30''cinema display
    ok thnx man. invisible would be best, cus I can't stand clutter

  4. #4
    Counter of sorts
    muso's Avatar
    Member Since
    Jan 15, 2003
    Location
    Whangarei, New Zealand
    Posts
    2
    Specs:
    Pwnt
    here you go: PHP hit counter

    Just the basic outline so you can understand what the code means;
    • Anything with a $ in front of it is a variable, it is either being assigned or being displayed
    • Page 2 is optional, leave it out if you want an invisible counter, just make sure you add the very first line of it to the page you want counted (the <?php include... ?> one) at the top of your document.
    • The stuff between the <? and ?> is the php code, and can be put inside another document or linked to as a separate one.
    • To use php scripts in a html document (not as a standalone one), the eaisest way is to rename your file from .html to .php


    What the script does: The file countFunction.php is a file that is separate from everything else and linked to from your index.php page (make sure your page is index.php not index.html). When the browser loads the page it also loads and executes that file. The php code asks the browser if the user has been counted already (in the current session) and if not, writes to the file counter.txt the new number of visitors.

    Something I find really useful but is completely unrelated: If you have a site where the same thing appears on each page but changes often (i.e. a news bar on the side or something you want to spotlight), put the corresponding code with all the html tags into a file, yourfilenamehere.txt. Take it out of the original page, and put this line of code into where you want the information displayed: <?php include "yourfilenamehere.txt"; ?>. Change index.html or whatever page it is to index.php and you&#39;re away. If you change the text file it will change the html file. So you can add this piece of code to any page you want and it will always display the same.

    [edit]Oops, for the function to be called that does all the work, you will need to have the line <?php Counter(); ?> in there somewhere... but this will display the number of hits. Edit the last line "echo &#036;finalcount" out of countFunction.php.
    I'm in your forums, writing sentences in a grammatically acceptable manner.

  5. #5
    Counter of sorts
    Emrys's Avatar
    Member Since
    Oct 27, 2002
    Location
    Vermont
    Posts
    1,345
    Specs:
    17" iMac G4 800MHz 1GB RAM
    Who is your host? You should be able to access web server statisctics.....
    Emrys
    Community Administrator / Moderator
    MAC-FORUMS.COM - The Ultimate Source For Your Mac!

  6. #6
    Counter of sorts
    Graphite's Avatar
    Member Since
    Feb 25, 2003
    Location
    Tropical Island, Jealous?
    Posts
    5,279
    Specs:
    MacPro 3.0Ghz 16GB RAM, 4x256 Vid, 30''cinema display
    Thnx muso big help (Ill end up messin up some lil thing so I know ill be back )

    Emrys, my host is my school... they weren&#39;t to clear on what we could have on our sites... ie software company site.. but I don&#39;t wana pester them in the case Im not suppose to have that that and im pretty sure the tech support here knows less then me (AND IVE NEVER SEEN THE SERVER).

  7. #7
    Counter of sorts
    Graphite's Avatar
    Member Since
    Feb 25, 2003
    Location
    Tropical Island, Jealous?
    Posts
    5,279
    Specs:
    MacPro 3.0Ghz 16GB RAM, 4x256 Vid, 30''cinema display
    Yeah, Im messing something up. Ive got class in 10 so perhaps im just in a rush.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 02-11-2013, 02:16 AM
  2. music video of sorts
    By secondGemini in forum Movies and Video
    Replies: 1
    Last Post: 04-10-2008, 07:37 AM
  3. Leopard/Tiger shell game of sorts
    By mongoloido in forum OS X - Operating System
    Replies: 3
    Last Post: 08-11-2007, 11:00 PM

Posting Permissions

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