how to assign javascript variable value to php variable

Using Cookie is the better solution i think –

<script> document.cookie = "myJavascriptVar = " + myJavascriptVar </script>
<?php
     $myPhpVar= $_COOKIE['myJavascriptVar'];
?>

Leave a Comment