Page 1 of 1

Refresh Stats Click Counter

Posted: Sun Apr 04, 2010 8:09 pm
by tomowa
Greetings, I'm a licensed user of Click Counter. Does exactly what I need.
Looking at the code, I am intrigued by the 'Refresh Stats' link and php coding, that truely reloads a new page.

Code: Select all

<a href="index.php?<?php echo mt_rand(1000,9999); ?>">Refresh stats</a>
I have it implemented on a page I use (unrelated to Click Counter, and is behind pw protected page), but when I click it,
http://www.seedrite.com/records/circle_status.php?2191
I end up with server response of "Invalid Variable Request", I imagine because the page does not know what to do with the appended 4 digit variable.
Studying your code, I cannot see how you work around this. Do you care to share? It would be worth another $15 to me :D I am far from being an accomplished coder :(
Thanks, Tom

Posted: Mon Apr 05, 2010 9:27 am
by Klemen
That's not a PHP issue, but an issue with the way your circle_status.php file handles input (or what variables it expects).

You can try fully defining a variable, for example instead of just "2191" use something like "&refresh=1291"

Code: Select all

<a href="circle_status.php?&refresh=<?php echo mt_rand(1000,9999); ?>">Refresh stats</a>
(if the circle_status.php doesn't expect any other variables you can skip the & before refresh)

Posted: Mon Apr 05, 2010 4:10 pm
by tomowa
Don't know what it does, but adding "refresh=" to the link did the job. Thanks!

Didn't buy you a beer, but instead just bought the HESK script. I plan to (sometime when time is found :( ), use it on the website I maintain for my towns chamber of commerce www.odessachamber.net. As is, when people send in an email inquiry from the contact form, it gets cc'ed to many people here, but know one knows if/anyone answers it. This should solve that problem 8).