assign value to php from js code example
Example: how to assign value of a js variable to a php variable
<script> document.cookie = "myJavascriptVar = " + myJavascriptVar </script>
<?php
$myPhpVar= $_COOKIE['myJavascriptVar'];
?>
<script> document.cookie = "myJavascriptVar = " + myJavascriptVar </script>
<?php
$myPhpVar= $_COOKIE['myJavascriptVar'];
?>