This is my code where I actually pass the value (variable countForPHP) using XHR:
xmlHttp.open("GET", "count.php?r=" + Math.random + "&count=" + countForPHP, async);
Here's how I get the value sent from the XHR:
$counter = $_GET["count"];
$pdo = new PDO('mysql:host=host;dbname=database;', 'username', 'password');
$sql = "UPDATE tbl_click SET click = click + ($counter)";
Does anyone know how to solve this problem?