Answers for "how to assign a js variable based on a php variable"

PHP
3

using js variable in php

<script type="text/javascript">
var abc= 'this is text';
<?php $abc = "<script>document.write(abc)</script>"?>   
</script>
<?php echo $abc;?>
Posted by: Guest on June-10-2020
0

how to assign value of a js variable to a php variable

<script> document.cookie = "myJavascriptVar = " + myJavascriptVar </script>
<?php
     $myPhpVar= $_COOKIE['myJavascriptVar'];
?>
Posted by: Guest on May-04-2020

Code answers related to "how to assign a js variable based on a php variable"

Browse Popular Code Answers by Language