I am working on a site for a friend who is releasing an energy drink. He has asked for some stuff that is a little advanced for me, and I told him I could try but he may need to get someone else. The page (so far) is here
The button there counts fine, but when I reload the page the variable is reset to 0. I keep thinking that I can use php to store that variable but I'm just not sure how and can't figure it out as I am new.
I'm helping him build this, but it's more for me to learn than anything. Any help on how to store the number of time that button is clicked would be appreciated. I need the count to be stored permanently, so when clicked by anybody anywhere it shows the total count...it acts like a like button so to speak.
<script type ="text/javascript">
var x = 0;
function count()
{
x += 1;
document.getElementById( "counting" ).value = x;
}
</script>
</head>
<body>
<input id = "counting" type = "text" / class="counter"><br>people are excited about<br> <strongb>EXP Energy!</strong></h1><p> </p>
Show EXP Energy some love and let the world know that you're excited about its release.
<p></center>
<p> </p><a class="push_button" href="#" input onclick = "count()"/>I'm Excited Too!</a>
</p>