Answers for "how to assign value from javascript to php variable"

PHP
2

how to use javascript variable in php

<script>
var p1 = "success";
</script>

<?php
echo "<script>document.writeln(p1);</script>";
?>
Posted by: Guest on August-17-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 value from javascript to php variable"

Browse Popular Code Answers by Language