+ Reply to Thread
Results 1 to 3 of 3

Thread: include counter w/o php

  1. Join Date
    Mar 2006
    Posts
    4

    include counter w/o php

    Hey. I'm wondering if it's possible to include this script without php; as, I use this php template script on my site and I can't seem to get php includes to work on my pages.

    Thanks,

    Ahni

  2. Join Date
    Aug 2004
    Posts
    781

    Re: include counter w/o php

    Yes, this is possible by using javascript.

    First, open up counter-display.html and replace its contents with:
    Code:
    document.write("<b>People Online:</b> !COUNTER-ONPAGE! <br>");
    document.write("<b>Today's Visitors:</b> !COUNTER-TODAY! <br>");
    document.write("<b>Total Visitors:</b> !COUNTER-VISITS! <br>");
    document.write("<b>Total Hits:</b> !COUNTER-HITS!");
    Then open up your templates, or where ever you add your custom code, and place the following in there:
    Code:
    <script type="text/javascript" src="/path/to/counter/counter.php"></script>
    Where /path/to/counter/counter.php is your relative path (not absolute). For example, if counter.php were located at http://www.site.com/counter/counter.php, then it would look like:
    Code:
    <script type="text/javascript" src="/counter/counter.php"></script>
    Fairly easy and simple

  3. Join Date
    Mar 2006
    Posts
    4

    Re: include counter w/o php

    Ay! I completely forgot about this. Sorry for the severely delayed response Patiek.

    Thanks for the help, it worked perfectly

+ Reply to Thread

Posting Permissions

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