I want to pass JavaScript variables to PHP variables.
var a=0 to $a
<script>
var a=0;
</script>
<?php
$a = 0;
?>
I want to pass JavaScript variables to PHP variables.
var a=0 to $a
<script>
var a=0;
</script>
<?php
$a = 0;
?>
Because JS runs on the client (the browser) and PHP runs on the server, there is no way for JS to talk directly to PHP, unless you include some heft HTTP-level communication, either via a FORM submit or AJAX (Your PHP can write directly out to the JS before it is sent to the browser, but not vice-versa)