I want to save the variable from JS named count into my MySql database.
let count = 0;
countup.addEventListener("click", function() {
count = count + 1;
counter.innerText = count;
let avgberechnung = count / 365;
avg.innerText = avgberechnung + " Ø Köpfe am Tag";
},false);
How can I do this?
Possible solution with php server
Use ajax to send request
$.post('save.php',{count:count})
.done(function(data){
alert("success -".data);
});
Create a PHP file (here save.php) to save the post data.
helpful links
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.