I'm attempting to create a "like count" on this banner i'm working on. I've created a button and I have a number above the button that goes up on every click. However once the page is refreshed it goes back to 0 or if someone else opens the page it'll be on 0 for them as well. Is there a way I can make it save the count on the server side so that no matter where you open the website it continues from the count saved to the server? here's my code below, any help is very appreciated thanks.
<div class="likecount" id="clicks">0</div>
<input type="button" class="button1" onClick="onClick()" value=" Like ">
and here is the javascript I have for the counter to work.
<script type="text/javascript">
var clicks = 0;
function onClick() {
clicks += 1;
document.getElementById("clicks").innerHTML = clicks;
};
</script>