Question : using js variable in php
Answered by : smoggy-spider-fnxqmxbrb3ok
<script type="text/javascript">
var abc= 'this is text';
<?php $abc = "<script>document.write(abc)</script>"?>
</script>
<?php echo $abc;?>
Source : https://stackoverflow.com/questions/11912908/how-to-use-javascript-variables-in-php | Last Update : Wed, 17 Jun 20
Question : how to assign value of a js variable to a php variable
Answered by : jaspreet-singh
<script> document.cookie = "myJavascriptVar = " + myJavascriptVar </script>
<?php $myPhpVar= $_COOKIE['myJavascriptVar'];
?>
Source : https://stackoverflow.com/questions/21620133/how-to-assign-javascript-variable-value-to-php-variable | Last Update : Mon, 11 May 20