CheckStat website counter

Hello everybody,

I want to install a website counter on my website. I got a code for this from CheckState. Below is a description of how to install the code. Can you tell me where and in which file I should place the code?

Instruction from CheckStat “Copy and paste it into your HTML page(s) between the BODY tags. The code should NOT be changed. This may cause the counter to stop counting or count incorrectly”.

Greetings Henk

Assuming it’s a script, You could insert it using the phplugins script hook.

If you need help with that, let us know. Be sure to also post the script you’re using.

Hi Rod,

I placed the script in “my-phplugins.php”. But don’t see any counter on the website.



Schermafbeelding 2022-12-28 om 14.56.18

You need to replace _HOOK_ with the name of the function you’re using

Instead of
function _HOOK_() {

use:
function scripts() {

and also delete the indicated line: /* DELETE THIS LINE

And actually, since you’ve got a lot of single quote marks in there you’ll either need to escape them by placing a backslash \ in front of each one or use this alternative method for the script hook:

function scripts() {
echo <<<SCRIPT

....your code...

SCRIPT;
	return false;
} // END /**/

more about that method here:


Like this?


This is the result.

Try capitalizing SCRIPTS like shown in the example above


It’s working!!!

Thank you Rod :wink:

:grinning:

That PHP construct is called a “heredoc” and there is also a “nowdoc” which is similar without parsing and suggested for code blocks.

Here is the link to the docs:
NowDoc
HereDoc

1 Like