Counter Code?

by 9 replies
10
I need a simple code for my website. Here's what I need.

I need a hit counter for my subscriber "thank you" page but I want the counter to show on my main homepage.

There are hundreds of counter scripts and that's fine but I don't know how to count hits to my thank you page and show it on the homepage.

Any ideas?

Thanks
Adam
#programming #code #counter
  • Adam,

    If you have a MySQL database, you could easily log each hit into the DB, then just query it on the main page. This would be your best bet.

    -John.
    • [1] reply
    • This is easy to do..
      What counting code are you running at the moment..

      Bruce
  • Adam,

    I'd be interested to know what reason(s) you have for wanting to display something like that on a web site. It's a phase that's passed most web development a few years ago.

    If you're wishing to concentrate on analysing your visitors, something like Google Analytics will give you a page by page breakdown.

    Tim.
    • [1] reply
    • I could imagine a couple of reason for doing something like this,
      eg. Wants to show how many people have signed up to his newsletter, when he can't get the numbers from his Autoresponder company..

      Plenty of reason to do something like this..

      Any thoughts on that code?

      Bruce
      • [1] reply
  • Ok..

    Put this on the thank you page :
    Code:
    <?php
    require_once('counter/counter.php');
    do_counter_hit('1');
    ?>
    Then put this on the index.php page
    Code:
    <?php
    require_once('counter/counter.php');
    show_counter('1');
    ?>

    It should all work OK now..

    Let me know how things go

    Bruce
    • [1] reply
    • Thanks Bruce, It worked! I really appreciate your help!

      Adam
      • [1] reply
  • MySql is the solution

Next Topics on Trending Feed

  • 10

    I need a simple code for my website. Here's what I need. I need a hit counter for my subscriber "thank you" page but I want the counter to show on my main homepage.