I would like to know how can I implement a hidden hit counter. I want to do this because I want to have an raspberry pi project were a light goes on every time the website get a hit, but I don't want to show the counter on the website.

有帮助吗?

解决方案

It is a website right? Then you can simply have the counter inside a div like this:

<div class="hitcounter"></div>

And hide it using CSS:

.hitcounter {display: none;}

This way, the counter will be present in the DOM and it won't be visible in the viewport. :)

其他提示

You can write php code in your index.php. There you can send data to your rasapberry pi each time the site gets loaded. On your raspberry pi you can run also a web application with php that tracks this calls and runs a program that switches your light!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top